I have this code:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
The problem is this code crash before it shows the alert, I have tested it on lower iOS and it work but on iOS 6 it crash.
I found the answer. I coded:
[alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:YES];
instead of
[alert show];
it crash because the process might not be performed in the main thread.
Source from: https://stackoverflow.com/a/12475858/1179680
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