【发布时间】:2011-01-13 21:40:27
【问题描述】:
我在视图控制器的init 方法中设置了一个通知观察者,如下所示:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(saveState)
name:UIApplicationWillResignActiveNotification
object:nil];
在哪里最好致电removeObserver:name:object: 获取此通知。我目前在我的 dealloc 方法中调用它,但想知道这是否会导致问题。
【问题讨论】:
标签: iphone objective-c cocoa-touch notifications nsnotifications