开发者

iPhone: UiNavigationController back button [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

How to tell when back button is pressed in a UINavigationControllerStack

When I press the back button, wha开发者_开发技巧t Delegate method is called?


UINavigationBarDelegate is the delegate class and it implements -navigationBar:shouldPopItem, since these controllers work in stacks you're just pushing or popping views. This will most likely always evaluate to true otherwise I feel a back button that does anything but pop a view controller will violate Apple's Human Interface Guidelines.


I agree with elsurudo, the - (void)viewWillDisappear also gets called when you go to a third ViewController, but maybe you want your connection to exist in the Third View Controller but not in the First View Controller. So you might want to detect when the user goes back from the Second View Controller so you can disconnect properly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜