【问题标题】:Notified with changes of Calendar events通知日历事件的变化
【发布时间】:2012-12-25 20:44:03
【问题描述】:

我想在我的应用程序处于后台时收到通知:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(calendarChanged:) name:EKEventStoreChangedNotification object:nil];

我尝试实现它,但 (calendarChanged:) 从未被调用?!

【问题讨论】:

    标签: objective-c xcode nsnotificationcenter eventkit


    【解决方案1】:
    1. 注册通知观察者时应指定EKEventStore对象

    2. 您的方法不会在后台被调用,它会在您的应用程序进入前台时被调用。

    取自this question搜索选项并没有什么坏处。

    【讨论】:

    • 如果他给对象传nil,那不是说不管是哪个对象发送,都会调用选择器吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-12
    • 1970-01-01
    • 2020-04-04
    • 2018-07-11
    相关资源
    最近更新 更多