How to deploy to Snow Leopard with ARC enabled

I have an OSX application that I would like to port to ARC. Everything works fine if I set the base SDK to 10.7. But when I set it to 10.6, it does not work (because it does not find _objc_release, etc.). So, how do I deploy my application to 10.6 with ARC support?

+8
automatic-ref-counting cocoa osx-snow-leopard
source share
2 answers

You set the SDK to 10.7 and the Target to deploy to 10.6.

Keep in mind:

While it is possible to create programs using ARC that run on Mac OS X 10.6 and iOS 4, nulling weak links is not available for these OSs. All weak links should be __unsafe_unretained here. Since non-zero weak links are so dangerous, this limitation significantly reduces the attractiveness of ARC for these OSs in my opinion.

Source: Automatic Link Counting

+12
source share

You may find PLWeakCompatibility useful. It allows the use of __weak variables on iOS 4 and OS X 10.6.

Source code here: https://github.com/plausiblelabs/PLWeakCompatibility
Additional information at http://www.mikeash.com/pyblog/introducing-plweakcompatibility.html

+7
source share

All Articles