简体   繁体   中英

ARC error when compiling

I'm trying to compile using the LLVM GCC 4.0 compiler, and I get this error in multiple of my .m files: ARC forbids explicit message send of 'release' I've tried using -fno-objc-arc as a compiler flag but that returns the error: Unrecognized command line option "-fno-objc-arc".

How can I solve this?

Simply remove all calls to -release . You're not allowed to call -release under ARC because the compiler will insert all the necessary retain / release calls for you. Read more about ARC here .

The other way is to use the conversion tool, and Xcode can convert your project to ARC (including removing these calls) for you:

To disable ARC entirely, change your build settings:

However I'd recommend you start using ARC, it will make things a lot easier and actually faster too.

如果您正在使用ASI( http://allseeing-i.com/ASIHTTPRequest/How-to-use )api,请参阅此答案,因为它需要使用特定类的-fno-obj-arc标志构建... 文件不支持ARC功能,如何处理和引用标题为“为这一类禁用ARC”的答案

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM