Trying to replace alertview with alertviewcontroller, using exact example from developer documentation, but keep getting the error that presentViewController method is not found.
Here is my code. I've tried to replace "self" with a dozen variations, all of which lead to app crash.
NSString* messageString = @"This is my message";
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Title"
message:messageString
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action){
NSLog(@"Ok button pressed");
}];
[alertController addAction:defaultAction];
[self presentViewController:alertController animated:YES completion:nil];