我在使后台提取工作时遇到问题。请参阅下面的代码。我在 info.plist 中添加了 fetch 作为后台模式。我使用 Debug -> Simulate background fetch 模拟提取。 控制台日志中没有任何输出。我很快就找不到任何好的例子。有谁知道如何让它工作?
func application(application: UIApplication!, performFetchWithCompletionHandler
completionHandler: ((UIBackgroundFetchResult) -> Void)!) {
println("Background fetch occured!");
completionHandler(UIBackgroundFetchResult.NewData)
}
最佳答案
我整个早上都在为这个问题而战,但我有一个不幸的解决方案:
根据 Xcode 6 发行说明中的“Known Issues”部分:
The Xcode menu command Simulator Background Fetch does not work.
Use the menu command in iOS Simulator instead. (20145602)
问题是模拟器中没有选项来触发它。
我已经测试过了,它仍然是 Xcode 6.3.1 中的一个问题
关于ios - 后台获取不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27281562/