开发者

App crashes immediately on iOS 3.x when compiled with Release build configuration

I'm facing quite "mysterious" problem. My App works fine with all build configurations on devices running iOS 4.x, but it crashes on iPhone running iOS 3.x immediately after launch, but only when compiled with Release configuration. With Debug config it runs with no problems, though.

I've spent a lot of time investigating possible cause of this, but was not lucky so far. I'm using XCode 3.2.4 with base SDK iOS 4.1, using LLVM GCC compiler. According to crash log, app crashes on v开发者_StackOverflowery first line of code in applicationDidFinishLaunching: method implementation, where nothing but simple [[SomeObject alloc] init] is called, reporting EXC_BAD_ACCES, indicating that alloc method didn't allocate the instance correctly (?).

When I switch to GCC 4.2 compiler, crash log reports completely other place of crash origin, but I assume this is quite the same...

I suppose I'm missing some compiler or linker flags or so, but cannot find out which. I've tried all suggested solutions I've found so far, but nothing helps.

Thanks for any help.


Are you using the LLVM compiler for the release build? In my experience, the LLVM compiler will weakly-link the API calls. This allows a 3.x app to run even if it has 4.x API calls as long as those calls are never executed. 3.x Apps compiled with GCC will crash on launch when the dynamic loader tries to resolve the 4.x APIs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜