我的应用在启动时崩溃,因为例外'无法及时更新场景'
这是因为可达性不能按时返回 这是堆栈跟踪
com.tjango.Plus3 failed to scene-update in time Elapsed total CPU time (seconds): 2.590 (user 2.590, system 0.000), 12% CPU Elapsed application CPU time (seconds): 0.302, 1% CPU Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0: _semaphore_wait_trap + 8 __dispatch_semaphore_wait_slow + 252 _xpc_connection_send_message_with_reply_sync + 184 ___SCNetworkReachabilityServer_targetStatus + 192 ___SCNetworkReachabilityGetFlags + 440 _SCNetworkReachabilityGetFlags + 232 -[Reachability currentReachabilityStatus] Reachability.m:295
仅在iOS 8上发生。
它卡住的功能是Apple的Reachability库: 我无法弄清楚为什么这个功能会阻止它。
- (NetworkStatus)currentReachabilityStatus { NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef"); NetworkStatus returnValue = NotReachable; SCNetworkReachabilityFlags flags; if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) { if (_alwaysReturnLocalWiFiStatus) { returnValue = [self localWiFiStatusForFlags:flags]; } else { returnValue = [self networkStatusForFlags:flags]; } } return returnValue; }
答案 0 :(得分:7)
可达性可能是iOS上最常用的错误库。这些规则有助于:
查看我的评论:iOS Reachability fails to catch the case where connected to WiFi but not logged in