If you don't need the delegate set it to nil
in the initialization
UIAlertView crashes when hit on OK buttons [closed]
-
04-07-2023 - |
Pregunta
My Application gets crashed when I hit on OK
button. I do a network interaction and whenever there is a timeout, I throw this alert message.
It works fine on iOS6 devices. I see this issue only on iOS7 devices.
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
if (self.urlConnection == connection) {
[self stopBlocking];
NSString *msg = @"Cannot connect to server. Please verify that you have a VPN connection.";
NSString *title = @"Connection Error";
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:msg
delegate:self
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alertView show];
[alertView release];
[ServerListener shouldRunSyncMethodTimer:YES];
}
}
No error on the console logs. No crash logs generated.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow