我们来看下crash log:
所有的这种类型的Exception都有共同的特性:
1. Exception Type都是: 00000020
2. Exception Codes都是: 0x000000008badf00d
3. Exception Note: SIMULATED (this is NOT a crash)。 这里明确指明 "this is NOT a crash",不是程序本身的崩溃,而是iOS系统强制关闭App产生的。
4. 崩溃堆栈都是定位在 View上面的
5. 在Xcode调试模式不会出错,真机运行才会crash
根据堆栈位置,发现是 sleep()函数的地方crash了
App rejection - Crash report says: failed to scene-create in time (badf00d) What is wrong?
这里有一段文字解释,比较清楚
The issue is very simple. You just spend too much time loading your app on the splash screen and the iOS device stops your app. The reason it only happens in the review and not when you test it is because you always run it from Xcode, and when running from Xcode it won't have this behavior. If you will run your app directly from the device (by tapping its icon) you will see it will happen there as well. Assuming you spent too much time loading on that specific run.
Edit: Also I am seeing that you are stuck on a semaphore and don't use too much CPU, which might mean you have a deadlock which stalls the app on the reviewer's device and that is why it spends too much time loading and the device stops your app. Not sure...
解决办法:
在App里,sleep()有关的调用不能太多