【发布时间】:2015-05-31 18:49:20
【问题描述】:
我正在创建一个 Apple Watch 应用,它有一个按钮可以调用父 iOS 应用。
WKInterfaceController.openParentApplication(message, reply: {
(response: [NSObject:AnyObject]!, error: NSError!) in
// processing data from iOS app
})
iOS 应用通过使用 EventKit 检索一些提醒来做出响应,如下所示:
eventStore.fetchRemindersMatchingPredicate(predicate, completion: {
[unowned self] reminders in
// sending back data as reply to Apply Watch
})
当父应用程序在前台时,一切都像魅力一样工作。但是当我让应用程序进入后台时,会发生一些奇怪的事情。对 EKEventStore 的调用,eventStore.fetchRemindersMatchingPredicate(predicate),从不调用我的完成块。所以我从来没有因此而向 Apple Watch 发送回复?
所以出了什么问题?我怀疑 EventKit 中存在错误,或者可能不支持在后台调用 EventKit。任何人都可以对此有所了解吗?
【问题讨论】: