46
在Xcode 7.0.1中,“模拟背景”获取命令导致performFetchWithCompletionHandler
被触发两次。PerformFetchWithCompletionHandler在使用Xcode进行模拟时调用了两次
这是Xcode调试错误,还是可以在运行应用程序的发布版本的设备上发生这种情况。
更新 现在我们有Xcode 7.1.1,仍然performFetchWithCompletionHandler
被调用两次。由于我不确定这是否也发生在“野外”,我保持一个状态,如果我的抓取动作已经在运行。
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler {
if (self.performingFetch) {
return completionHandler(UIBackgroundFetchResultNoData);
}
self.performingFetch = YES;
...
self.performingFetch = NO;
}
我遇到同样的事情(不管在启动过程中是否调用[application setMinimumBackgroundFetchInterval:]')。 – Graham
这有什么更新?我也经历过同样的事情。 – Marcel
这里同样的事情。 xcode 7和ios 9 – user3687