Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4.4, build app with ARC for iOS 4.2

Xcode 4.4, Mountain Lion, llvm 4.0 compiler. I build my app, it works on ios5, ios6 devices, but on iphone 3g with ios 4.2 I have such error:

dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
Referenced from: /var/mobile/Applications/68B78A19-71E6-4BDA-B997-B7DED4D02429/iGuides.app/iGuides
Expected in: /usr/lib/libobjc.A.dylib

dyld: Symbol not found: _objc_storeStrong
Referenced from: /var/mobile/Applications/68B78A19-71E6-4BDA-B997-B7DED4D02429/iGuides.app/iGuides
Expected in: /usr/lib/libobjc.A.dylib

On Xcode 4.3 everything was working, because I use only strong and unsafe_unretained modifiers.

I see, that no arc libs were linked to my app.

I was trying to link manually with libarclite_iphoneos.a, no reaction. I added -fobj-arc to link flags, no reaction.

I thought, that iPhone 3g support will be dropped in XCode 4.5, not 4.4. Is it so?

like image 873
Gleb Tarasov Avatar asked Aug 09 '12 22:08

Gleb Tarasov


Video Answer


2 Answers

I've just found problem. Error was because of iRate library, when I remove reference to this lib, everything starts working.

Upd: after updating to last version everything works nice. Thank you @Nick Lockwood for explanation: on iOS arclite lib loads after [class load] methods executed. So you need to delay initialization. In iRate he inserted performOnTheMainThread in load method.

like image 105
Gleb Tarasov Avatar answered Nov 15 '22 05:11

Gleb Tarasov


Try to add -fobjc-arc in Other Linker Flags.

like image 23
Johnnywho Avatar answered Nov 15 '22 06:11

Johnnywho