Site icon Ravi Shankar

How to disable arc for specific classes in Xcode

Xcode provides option to disable arc only for specific classes by providing a compiler flag. This is quite useful when you are including framework written prior to iOS 5 in your project. Let us see the steps required for specifying the compiler flag in Xcode.

In the above screenshot, you can see errors rested ARC restrictions for NSStream+ SKSMTPExtensions.m class file. You can resolve this error by providing the compiler flag -fno-objc-arc for this class.

Click the Project on Xcode then Build Phases tab. Navigate to Compile Sources section and double click on Compiler flags for the corresponding file. Now enter the flag “ -fno-objc-arc” as shown in the below screenshot.

This should resolve all the compilation related with ARC.

Exit mobile version