Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARC App Crashes when accessing @property form ARC static lib

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.

like image 208
Richard Stelling Avatar asked Sep 28 '12 13:09

Richard Stelling


1 Answers

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.

like image 54
Richard Stelling Avatar answered Nov 15 '22 21:11

Richard Stelling