iPhone app crashes only in Release mode on 3G

前端 未结 5 1659
孤独总比滥情好
孤独总比滥情好 2020-12-18 04:06

I have an app I\'m writing that crashes when I call addSubview on a UIScrollView with \"EXC_BAD_ACCESS\". It only does this on iPhone 3G in release mode and only on the devi

5条回答
  •  别那么骄傲
    2020-12-18 04:39

    I had the exact same problem recently, however I am not entirely sure the cause is the same. What I can tell you though is what resolved the issue for me (although I'm still not entirely satisfied with the solution).

    In the end, it seems like a compiler issue, and this might confirm what others have said about compiler optimization. I am using Xcode 4.0 (build 4A304a). The issue was with LLVM compiler 2.0 Code Generation. One key in particular: "Optimization Level"

    Debug was set to "None". Release was set to "Fastest, Smallest"

    Changing Release to "None" fixed the crash (and similarly changing Debug to "Fastest, Smallest" caused the app the crash on launch).

提交回复
热议问题