Attempt to dismiss from view controller UINavigationController while a presentation or dismiss is in progress

I am using Xcode v4.6.1 and am trying to learn to make apps for the iPhone. I am creating a 'to do list'. The opening view is a tableView embedded in a navigation controller; 'Checklist'. The navigation controller has an add bar button which on tap will display a scene (another tableView embedded in a navigation controller); 'Add Item') . The Add Item scene's navigation controller has a 'Cancel' bar button. When the 'Cancel' button is tapped, I get the following message:

"Attempt to dismiss from view controller <UINavigationController: 0x713d260> while a presentation or dismiss is in progress!"

The code for dismissing the 'Add Item scene is a delegate from the 'Add Item' scene. The code below is a delegate protocol declared in the controller for the 'Add Item' tableView.

- (void)itemDetailViewControllerDidCancel:(ItemDetailViewController *)controller
    [self dismissViewControllerAnimated:YES completion:nil];

Any suggestions would be appreciated.

Who is Participating?
pgnatyukConnect With a Mentor Commented:
You need to show the code opening the detail view you're talking about.

Mainly, if you use UINavigationController you should see a navigation bar and button back on left. This button is supposed to bring you back from the detailed view.

In this case you don't need to call any dismissViewController method - this method is used when you show a view in a "modal" mode by using presentViewController method.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.