本文介绍了升级到Xcode4.5 iOS6 Base SDK后的运行时异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的代码库升级为使用iOS6 Base SDK - 我使用的是XCode 4.5。我只需要将dylibxml2.2.3.7更改为dylibxml2.2。它在6.0模拟器上运行良好。我正在使用像GoogleAnalytics,T​​hree20这样的库。

I recently upgraded my codebase to use iOS6 Base SDK - I am using XCode 4.5. I only had to change the dylibxml2.2.3.7 to dylibxml2.2. It works fine on the 6.0 simulator. I am using libs like GoogleAnalytics, Three20.

但是当我在iOS 5(iPhone4)上运行代码时,它会在启动时崩溃并出现以下错误:

But when i run the code on iOS 5 (iPhone4), it crashes at launch with this following error:

我无法确定它到底在哪里崩溃,因为我看到的只是崩溃时的机器码

I can't tell where it is exactly crashing because all I see is the machine codes when it crashes

dyld的:延迟符号绑定失败:符号未找到:_objc_setProperty_nonatomic

从参考:/用户//库/应用程序支持/ iPhone模拟器/ 5.0 /应用//

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/系统/图书馆/框架/ Foundation.framework / Foundation

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation


推荐答案

我也遇到同样的错误在构建我自己的lib并在我的示例代码中运行它时。仔细阅读构建日志后,我现在找出原因。

I meet the same error too when building my own lib and run it in my sample code. After reading the build log carefully, I figure out the reason now.

我将部署目标设置为iOS 3.0,但最新的Xcode仅支持iOS 4.3及更高版本。因此,编译器会自动将部署目标设置为iOS 6.0,只要项目在iOS 6.0下运行,就会生成错误。我通过在我的lib项目中将部署目标设置为iOS 4.3来修复它。

I set my deployment target to iOS 3.0, but the latest Xcode only support iOS 4.3 and later. So the compiler automatically set the deployment target to iOS 6.0, which generates error whenever the project is running under iOS 6.0. I fixed it by setting the deployment target to iOS 4.3 in my lib project.

这篇关于升级到Xcode4.5 iOS6 Base SDK后的运行时异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 08:49