tags:

views:

32

answers:

3

When I click the table row, go back to previous view without clicking back button.

I try

[self.navigationController dismissModalViewControllerAnimated:YES];

it's not working. How to dismiss pushViewController ?

+1  A: 
[self.navigationController popViewController:YES]
kovpas
A: 

With that line you are dismissing a modal view. That is not the same thing as popping controllers from the navigation controller stack.

You should instead do this:

[self.navigationController popViewControllerAnimated:YES];

This will pop the top controller.

Here is a link to the documentation.

Thomas Børlum
+1  A: 

dismissModalViewControllerAnimated is used to dismiss a Modal View Controller. These are the view controllers that slide up from the bottom of the screen. An example would be when you tap the button to compose a new email in the Mail app.

If you want the navigation controller to pop back to the previous view controller try using

[self.navigationController popViewControllerAnimated:YES];

Here's a link to the documentation for UINavigationController http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UINavigationController_Class/

Brandon Schlenker