开发者

Controlling changes in the navigation stack

I want to be able to check for specific conditions when a user selects the "back" button from a naviga开发者_Python百科tion controller - then display an alert and stop the pop up the navigation stack from occurring.

I can get notified in the viewWillDissappear method that the pop is about to occur - but is there a mechanism to stop the pop from happening?


You can try subclassing UINavigationController and then override the popViewController method to include your logic.

- (UIViewController *)popViewControllerAnimated:(BOOL)animated

[edit to include an example] http://www.hanspinckaers.com/custom-action-on-back-button-uinavigationcontroller

Cheers, Rog

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜