Wednesday 20 February 2013

Use Compiler Flags to Enable and Disable ARC



ARC is supported in Xcode 4.2 and later OS X v10.6 and later (64-bit applications) and for iOS 4 and later. Weak references are not supported in OS X v10.6 and iOS 4. There is no ARC support in Xcode 4.1 and earlier.

Enable ARC -> -fobjc-arc
Disable ARC -> -fno-objc-arc

Project -> Build Phases -> Compiler Sources -> Set Compiler flag for particular file.

You enable ARC using a new -fobjc-arc compiler flag. You can also choose to use ARC on a per-file basis if it’s more convenient for you to use manual reference counting for some files.
 For projects that employ ARC as the default approach, you can disable ARC for a specific file using a new -fno-objc-arc compiler flag for that file.

1 comment: