So I noticed that in iOS8 beta 3 (Update: still happens in iOS 11.2) on iPad, when attempting to present a view controller from within a delegate method of
You can try to do your job (presenting view controller) in
- (void) actionSheet:(UIActionSheet *)actionSheet
didDismissWithButtonIndex:(NSInteger)buttonIndex {}
instead of
- (void) actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex {}
as @LeoNatan said, "The problem seems to come from Apple's switch to using UIAlertController internally to implement the functionality of alert views and action sheets". So you must to wait the action sheet dismissed, then present the view controller you want.
@LeoNatan's solution just block the UI at main thread, so it'll also make sure the view controller will be presented after the action sheet was dismissed.
Try
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// action sheet presentation
// or modal view controller presentation
// or alert view presentation
}];
Issuing a
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
on
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
before trying to present another modal view worked for me.