Copy this bookmark:



description:


tags:



bookmark detail

Tip: Ensuring ARC is Enabled at Compile Time. | iOS Developer Zone
Tip: Ensuring ARC is Enabled at Compile Time.

If you still have legacy code around that is not compiled with Automatic Reference Counting (ARC), accidentally adding some new code that assumes that ARC is enabled can lead to extensive memory leaks.

This simple test, placed in a .m file, will prevent the file from compiling if ARC is not enabled.

#if  ! __has_feature(objc_arc)
#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
ios 
april 2013 by yasuyk
view in context