问题描述
我有一个ARC()构建静态库(也是ARC)的应用程序。该应用程序将正常启动,但当执行一个读取或写入静态库中@property的操作时,应用程序将崩溃并显示以下错误:
I have a ARC (automatic-reference-counting) app that builds a static library (also ARC). The app will launch fine but when the an action is performed that reads or writes to a @property in the static library the app will crash with this error:
dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic
Referenced from: /var/mobile/Applications/0E7ADBB4-FFE5-4CEB-B418-8A35A92E99D4/MyApp.app/MyApp
Expected in: /usr/lib/libobjc.A.dylib
dyld: Symbol not found: _objc_setProperty_nonatomic
Referenced from: /var/mobile/Applications/0E7ADBB4-FFE5-4CEB-B418-8A35A92E99D4/MyApp.app/MyApp
Expected in: /usr/lib/libobjc.A.dylib
所有建议都是关于将非ARC库链接到ARC应用程序(反之亦然)。但这些都是ARC。
All the advice has been about linking non-ARC libraries to ARC Apps (or vice-versa). But these are both ARC.
推荐答案
应用程序的基本SDK
已设置到iOS 6和 iOS部署目标
设置为iOS 5.0但是对于静态库, Base SDK
& iOS部署目标
设置为iOS 6.
The app's Base SDK
was set to iOS 6 and iOS Deployment Target
was set to iOS 5.0 however for the static library both the Base SDK
& iOS Deployment Target
were set to iOS 6.
确保 Base SDK
&应用程序和库中匹配的 iOS部署目标
解决了这个问题。
Making sure the Base SDK
& iOS Deployment Target
matched in the app and library solved this problem.
这篇关于访问@property表单ARC静态库时ARC App崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!