开发者

back in navigationController

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

I try

[self.navigationController dismissModalViewControllerAnimated:YES];

it's not workin开发者_如何学Cg. How to dismiss pushViewController ?


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/


[self.navigationController popViewController:YES]


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜