我想观察日历应用程序的更改,因此我注册了 EKEventStoreChangedNotification
通知。但是我是否需要有一个“事件”的 EKEventStore
对象才能接收此通知?我想我正在初始化 View Controller 中的 EKEventStore 对象来检索一些事件。然后我将弹出导航堆栈的此 View Controller ,并且 View Controller 将被释放,因此 EKEventStore
对象将被释放。
最佳答案
不,您不需要保持 EKEventStore 对象处于事件状态,因为您已经使用名为 eventStore 的 EKEventStore 对象注册 EKEventStoreChangedNotification
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(storeChanged:)
name:EKEventStoreChangedNotification object:eventStore];
引用this进一步消除您的疑虑
关于iOS – Event Kit编程监听通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12323796/