2

I've got a chat app and I simply want to let the connection manager to leave the current chatroom when the back button on my UINavigationController is pressed (or the view is left in any other way). viewWillDisappear: isn't working for me.

Unlike some others with issues ( UINavigationController and viewWillDisappear for instance) I have what should be a totally textbook view setup - one UINavigationController, leading into a bunch of subclassed UIViewControllers connected by segues. What can I do to detect when I leave the chatroom view controller?

4

2 回答 2

1

Xcode 自动完成功能让我受益匪浅!

- (void)viewWillDisappear:(BOOL)animated工作正常由于某种原因,Xcode 还建议

- (void)viewWillDisappear 哪个不起作用!

与此处相同: viewDidDisappear 未在 UINavigationController 上被调用

于 2012-08-14T16:12:18.937 回答
1

你确定它设置好了?我刚刚在 Xcode 中使用 Master-Detail 模板创建了一个新项目,我将它添加到我的详细视图控制器中,当我按下返回按钮时,“gone ...”按预期记录......

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];

    NSLog(@"gone...");
}
于 2012-08-14T01:55:19.290 回答