ARC App Crashes when accessing @property form ARC static lib

本小妞迷上赌 提交于 2020-01-01 02:44:12

问题


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

All the advice has been about linking non-ARC libraries to ARC Apps (or vice-versa). But these are both ARC.


回答1:


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.

Making sure the Base SDK & iOS Deployment Target matched in the app and library solved this problem.



来源:https://stackoverflow.com/questions/12641190/arc-app-crashes-when-accessing-property-form-arc-static-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!