从iOS6的后台返回后应用程序崩溃



我有一个应用程序在iOS 5上运行良好,但是在iOS 6上进行一些测试后,它运行良好,除了在运行后返回应用程序时。一旦它从后台返回,它就会无响应,然后在大约 10 秒后崩溃。

WillEnterForeground() 执行得很好,里面只有一些简单的代码。

检查手机上的控制台,我看到以下内容:

Sep 20 16:41:07 Seans-iPhone-4 kernel[0] <Debug>: launchd[985] Builtin profile: container (sandbox)
Sep 20 16:41:07 Seans-iPhone-4 kernel[0] <Debug>: launchd[985] Container: /private/var/mobile/Applications/F73BBA70-90D1-4CB6-B7F3-FF10289396A9 (sandbox)
Sep 20 16:41:29 Seans-iPhone-4 backboardd[52] <Warning>: TrekkTrakker failed to resume in time
Sep 20 16:41:29 Seans-iPhone-4 backboardd[52] <Warning>: Forcing crash report of TrekTrakkerSimp[985]...
Sep 20 16:41:30 Seans-iPhone-4 backboardd[52] <Warning>: Finished crash reporting.
Sep 20 16:41:30 Seans-iPhone-4 com.apple.launchd[1] (UIKitApplication:TrekkTrakker[0x28c2][985]) <Notice>: (UIKitApplication:TrekkTrakker[0x28c2]) Exited: Killed: 9
Sep 20 16:41:30 Seans-iPhone-4 backboardd[52] <Warning>: Application 'UIKitApplication:TrekkTrakker[0x28c2]' exited abnormally with signal 9: Killed: 9
Sep 20 16:41:30 Seans-iPhone-4 ReportCrash[987] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Sep 20 16:41:31 Seans-iPhone-4 ReportCrash[987] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/TrekTrakkerSimple_2012-09-20-164129_Seans-iPhone-4.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

有人遇到类似的问题,或者知道会发生什么?

如果您不使用 ARC,则很可能是您向其发送消息的发布内容的问题。几乎每个已经发布的iOS版本都暴露了一些错误,这些错误一直存在,但由于某种原因直到新版本才浮出水面。

在调试器中运行,并查看崩溃位置附近的关卡中的所有代码,例如未保留的对象或您虽然保留但不是的对象。

您的应用程序崩溃或被 WatchDog 强制退出,因为应用程序在 10 秒窗口中没有响应。这意味着您的应用程序启动时间过长,这可能是由于呼叫卡在iOS 6上,或者iOS 6设备由于某种原因运行速度稍慢。使用时间探查器工具查看启动时间的去向,并确保应用程序DidFinishLaunching:尽快返回,大多数看门狗崩溃的情况都是由于该方法的挂断造成的。

最新更新