Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SBJson (ARC) on iOS 4.3 #111

Closed
hohl opened this Issue · 9 comments

5 participants

@hohl

When trying to run my app using latest SBJson build (including ARC) on iPhone 4.3 Simulator the application crashes on runtime with the following message and stops inside the init of SBJsonParser (line:41@SBJsonParser.h):

dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
Referenced from: [...]
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

Any idea what went wrong?

@stig
Owner
@hohl hohl closed this
@x2on

ARC is supported on iOS 4. Only weak references are not supported on iOS 4...

From Apple Developer Docs:

ARC is supported in Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit applications) and for iOS 4 and iOS 5. Weak references are not supported in Mac OS X v10.6 and iOS 4.

http://developer.apple.com/library/ios/releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html#//apple_ref/doc/uid/TP40011226-CH1-DontLinkElementID_1

@stig
Owner
@hohl hohl reopened this
@ricsantos

Add -fobjc-arc to your Other Linker Flags in Build Settings

@stig
Owner
@hohl

Quote of an Apple developer:

For iOS 4 and Mac OS 10.6, the compiler adds a bit of runtime compatibility glue code to your app. This works for everything except __weak variables, which require more support than the compatibility code can provide. ARC on iOS 4 is simpler than non-ARC code, but it's not as simple as ARC on iOS 5.

@x2on

Is there any source for this quote? Im really interested in this part.

@quellish

There is some mention of this towards the end of the WWDC 2011 talk "Introducing Automatic Reference Counting".

https://developer.apple.com/videos/wwdc/2011/

Apple's ARC transition guide talks about potential gotchas:
https://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html

Mike Ash also has a good article on ARC, though not specifically about iOS 4.x:
http://www.mikeash.com/pyblog/friday-qa-2011-09-30-automatic-reference-counting.html

@stig
Owner

The tests seems to run fine in the 4.3 simulator so I'm closing this issue. (I don't have an actual device with iOS 4.3 on.) Feel free to re-open if this is still an issue.

@stig stig closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.