Hi,
On Sun, Dec 23, 2012 at 6:10 AM, gratner <[email protected]> wrote:
> For the benefit of others, I think I have gotten to the bottom of this.
> Looking at the class below, if you remove the lock statements, this will
> cause hard crashes throughout the app. Neither monotouch nor xcode will
> provide a stack trace in this case. When Spinner.Show() is called before
> (on
> previous screen for example) Spinner.Hide() didn't finish, everything will
> blow up.
>
> public class SpinnerHelper
> {
> private string _title;
> public const string DEFAULT_TITLE = "Loading Data. Please
> Wait";
> private UIAlertView _alert;
> private System.Object lockThis = new System.Object();
> private const string _title = "Loading, please wait";
>
> public void Show ()
> {
> lock (lockThis)
> {
> if (_alert == null)
> {
> _alert = new UIAlertView (_title,
> "", null, null, null);
> }
> _alert.Show ();
> }
> }
>
> public void Hide ()
> {
> lock (lockThis)
> {
> _alert.DismissWithClickedButtonIndex (0,
> true);
> _alert.Dispose ();
> _alert = null;
> }
> }
> }
>
You should not need locks if you only interact with the UI on the main
thread. If the locks fixes anything at all it means you're not following
that rule. That said, recent versions of MonoTouch should catch illegal
thread usage and show a helpful exception/message - did you disable that
thread check (or are you using an old version of MonoTouch?)
Can you also get the device log and see if anything is shown there? At the
very least you should get a line saying something like "YourApp exited with
exit code ##".
Rolf
>
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/MonoTouch-crashes-with-no-stack-trace-or-crash-report-both-Sim-and-Device-tp4657886p4657889.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch