I have the following modal alert method:
public static int ShowModal (string title, string message,
string
cancelButtonTitle = "Cancel", string[] otherButtons = null)
{
int clickedButtonIndex = -1;
using (UIAlertView alert = new UIAlertView(title,
message, null,
cancelButtonTitle, otherButtons))
{
alert.Show ();
alert.Clicked += (sender, buttonArgs) =>
{
clickedButtonIndex =
buttonArgs.ButtonIndex;
};
while (clickedButtonIndex == -1)
{
NSRunLoop.Current.RunUntil
(NSDate.FromTimeIntervalSinceNow (0.25)); //
Wait 1/4 of a second
}
return clickedButtonIndex;
}
}
What I'm trying to do is, in the view's ViewDidAppear event, render an
alert, prompting the user to make a selection:
if (Alert.ShowModal ("A new article is available", "Do you want to retrieve
it now?", "No", new [] { "Yes" }) == 1)
{
// Do stuff
}
What's happening, though, is that the screen dims/darkens but the alert
message box doesn't appear at all. After a few seconds, my app crashes.
Can anyone see why this might be happening?
Thanks
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/UIAlertView-s-alert-message-box-not-displaying-tp4418334p4418334.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch