升级后 说 ARC 在 iOS4.3 及更高版本中受支持.据我所知,我的应用程序不使用 ARC,也不使用它的任何依赖库.答案还谈到了弱引用归零,这似乎......也许是相关的,因为很多人已经成功地删除了与 libSystem.B.dylib 的弱引用有关的特定链接器指令.
我不得不将我的基本部署目标提升到 4.0 以上,这让我有点困扰,因为这感觉就像我正在削减很多潜在用户.尽管 Apple 希望每个人都能升级他们的设备,但很多人并没有这样做.哦,好吧.
值得一提的是,这个项目最初是在 Xcode3 下完成的,所以项目本身可能只是一些奇怪的东西,既不需要也导致了这个问题.但是如果我能找到它,我会被诅咒的!
好吧,好吧,好吧……经过进一步检查……我在我的 project.pbxproj 文件中发现了 2 个对 libSystem.B.dylib 的错误引用,这些引用在 Xcode 的构建设置中是不可见的,但我必须通过使用文本编辑器!
完成此操作后,我将基本部署版本重置为 4.0,为 iOS5 模拟器构建,应用程序运行没有问题.
太棒了.
教训:永远不要低估项目文件中出现垃圾的可能性.
删除 Xcode 项目包内的 project.pbxproj
文件中出现的 3 行这些行(右键单击并显示包内容).
After upgrading xcode4.1/ios4 to xcode4.2/ios5 I am experiencing crashes while the App is loading and before it even enters main()
.
I have set a break point in main()
but it is never reached.
Base SDK
of 4.3 works fine on iOS 4.x and iOS 5.Base SDK
of 5.0 works fine on 4.x but crashes in iOS 5, both on the simulator and on a device.Crashes with EXC_BAD_ACCESS
List of calls, all system calls, not even the main()
has not been called yet.
My best guess is a problem loading a library, but have know idea how to track it down!
Derived Data
folder
What is your deployment target?
My deployment target was iOS4.0. I changed it to iOS4.3 and the issue is resolved! (Building against iOS5 GM SDK, of course.) My app now runs in the iOS5 simulator.
I got this idea from an answer in another SO thread that said ARC is supported in iOS4.3 and above. My app doesn't use ARC, nor do any of it's dependent libraries, as far as I can tell. The answer also said something about weak reference zeroing, which seemed... perhaps relevent since a lot of people have had success in removing specific linker directives concerning weak references to libSystem.B.dylib.
It bothers me a little that I have to move up my base deployment target beyond 4.0 because that feels like I am cutting out a lot of potential users. Despite Apple's hope that everyone will always upgrade their devices, many people do not. Oh well.
It's worth mentioning that this project was originally done under Xcode3, so there is likely just some bizarre cruft in the project itself that is both unneeded and causing this problem. But I'll be damned if I can find it!
Well, well, well... upon further inspection... I found 2 errant references to libSystem.B.dylib in my project.pbxproj file that were not visible through Xcode's build settings, but that I had to remove by hand with a text editor!
Once doing this, I reset the base deployment version to 4.0, built for the iOS5 simulator, and the app ran without issue.
Amazing.
The lesson: Never underestimate the chances for there to be garbage in your project file.
Removing the 3 occurrences of these lines in the project.pbxproj
file inside the Xcode project package (right click and show package contents).
这篇关于iOS App 在使用 Xcode 4.2 & 进入 main() 之前崩溃iOS 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!