For some reason screen gets dark and freezes, alert is not shown... can someone please help?
Thanks in advance!
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
message:@"Hello!" delegate:self
cancelButtonTitle:@"Done"
otherButtonTitles:nil];
[alert show];
[alert release];
}
You are probably calling show
from a background thread, call it on the main thread like this:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
message:@"Hello!" delegate:self
cancelButtonTitle:@"Done"
otherButtonTitles:nil];
[alert performSelectorOnMainThread:@selector(show)
withObject:nil
waitUntilDone:NO];
[alert release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With