Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one turn ARC off for specific file

I know I am supposed to add the compiler flag -fno-objc-arc to the compile sources in XCode 4 to accomplish this. But it isn't working. Even with the added flag I am still getting errors in my KeychainItemWrapper.m file claiming I need to use __bridge for C pointers.

I have added the required flag to the compiled sources... what am I missing?

My project is ARC safe, but the Apple provided reference for interacting with the Keychain is not. I would like to just disable ARC for that single file. What else am I missing here?

like image 353
Justin Avatar asked Nov 23 '11 20:11

Justin


2 Answers

I've had this happen more than once for me in 4.2 in different projects, but then I've not been able to reproduce it reliably enough for a bug report. But I can say in my cases, a clean build cleared it up.

like image 124
Firoze Lafeer Avatar answered Oct 23 '22 11:10

Firoze Lafeer


Click the Edit menu, go to Refactor > Convert to Objective-C ARC... Click the disclosure triangle next to your project name and check all files for which you want to use ARC.

like image 28
Drew C Avatar answered Oct 23 '22 10:10

Drew C