Warning: Attempt to present ModalTableViewController on MainTableViewController which is already presenting (null) Warning: Attempt to present ModalTableViewController on MainTableViewController which is already presenting (null) ios ios

Warning: Attempt to present ModalTableViewController on MainTableViewController which is already presenting (null)


I had this issue because I was trying to perform segue / present from within:

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex

I changed it to:

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

and it fixed it!


I'm not on swift yet, but for Objective-C, I ended up wrapping the presentViewController call in a performSelector call.

-(void) present{    [self performSelector: @selector(ShowModalTableViewController) withObject: nil afterDelay: 0];}-(void) ShowModalTableViewController{    [self presentViewController: ctrlModalTableViewController animated: true completion: nil];}


This will work also:

dispatch_async(dispatch_get_main_queue(), ^ {        [self presentViewController:vc animated:YES completion:nil];});