iOS App crashing before entering main() with Xcode 4.2 & iOS 5

后端 未结 12 2673
一整个雨季
一整个雨季 2020-12-10 12:50

Background

After upgrading xcode4.1/ios4 to xcode4.2/ios5 I am experiencing crashes while the App is loading and before it even enters main().

12条回答
  •  失恋的感觉
    2020-12-10 13:01

    I had the exact same diagnostic, but the solution was entirely different.

    However, the solution described in the answers here didn't work for me, because I found no "weak"-related issues in my project.pbxproj

    However, I found that the cause of my problem was a deadlock in an +(void)initialize method called from the main thread. In this method, I was calling dispatch_sync(dispatch_get_main_queue(), ^{[some block code]}). Changing this to a dispatch_async (note the "a") solved my problem.

    The way I discovered the issue was accidental. While nothing seemed to happen, the "thread" navigator of Xcode was telling me that the app itself wasn't crashed. And I accidentaly clicked on "pause" in the debugger. And suddenly it stopped exactly where the deadlock was. Which after some thoughts is just logically obvious.

提交回复
热议问题