iOS do not like so much modal things forced like that. It's really usefull
to me like common messagebox, but maybe not for stop at a specific line to
make a choice. Maybe it's better to have a view/form giving the choice for
user and navigate to the next correct view or wathever.

But I think that Miguel can explain more about what happens inside iOs that
make to fail that. But I can say that iOS has a preference for async things.

And on ViewDidLoad, do it fail too? Another thing you can try it to put on
an InvokeOnMainThread, I can't remember now why I make that but I'm using:

int clicked = -1;

UIAlertView uiAlertView = new UIAlertView();

uiAlertView.Title = Title;

uiAlertView.Message = Message;

uiAlertView.InvokeOnMainThread(delegate{

    uiAlertView.Show();



    uiAlertView.Clicked += (sender, buttonArgs) => {

        Console.WriteLine ("User clicked on index {0}",
buttonArgs.ButtonIndex);

clicked = buttonArgs.ButtonIndex;

    };

    while (clicked == -1)

    {

NSRunLoop.Current.RunUntil (NSDate.FromTimeIntervalSinceNow (0.5));

    }

});


return clicked;

Maybe it's changes nothing for you but it's on production environment on
iPad used to show messages with OK or with buttons like Yes/No or OK/Cancel.
But I think never used on ViewDidAppear, just on ViewWillAppear (to inform
user that something is wrong on database at first viewcontroller after
login).

Karl


_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to