ios - 如何解决这些 CloudKit 后台任务警告
问题描述
我有一个正常运行的 iOS 应用程序,它产生了一些令人不安的警告消息,我想解决它们。
从控制台:
Background Task 37 ("CoreData: CloudKit Import"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
但是,此警告会定期重复,每次使用不同的任务 ID。我想如果我可以捕获任务 ID,我可以确定在哪里调用
UIApplication.endBackgroundTask(_:)
我不知道是否可以获取任务 ID。我确实设置了一个通知观察器来检查数据更改。我不想删除它。
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
OperationQueue.main.addOperation({ () -> Void in
self.fetchProjects()
})
}
解决方案
推荐阅读
- c - FUSE: Transport endpoint is not connected
- python - Python-docx:是否可以在特定位置的段落中添加新的运行(而不是在末尾)
- react-native - 反应本机开发服务器返回响应错误代码500
- android - 从字符串显示geojson
- xpages - Domino Designer V10 的哪个 Openntf Domino API
- swift - Swift - NSCoding 一个集合
- java - 如何将报告门户集成到 pom.xml?
- jquery - 外部文件和jquery
- javascript - 将 PHP 响应对象转换为 Javascript 对象
- php - laravel join:如何连接表并根据我的条件从同一个连接中提取各种数据?