如何在项目之间添加ARC
我正在创buildiPhone应用程序,我需要使用SDWebImage
。 为此,我需要使用ARC。
任何想法如何在项目之间添加ARC?
注意:在一个文件中我有下面的内容。
#if !__has_feature(objc_arc) #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag #endif
我应该在哪里添加-fobjc-arc
标志?
Select Project Form Project Manager | | Targets | | Build Phases | | Compile Sources | | Select File that you Want to crate as ARC. (You can also Select Multiple File name from here) | | Press "ENTER" key | | Popup Box/Window is displayed | | Write here - '-fno-objc-arc' | | And again Press 'ENTER' key. Your selected file is being ARC.
如果您使用的是xcode 4.6,那么select您的目标Target
– > Build Settings
并findApple LLVM编译器4.2在本节中看到Objective-c自动引用计数是否设置为YES ,如果不是则将其设置为YES。 对于旧版本的XCode,您可以更改为Apple LLVM compiler 3.0
Change from build settings Project->Build setting->Objective-C Automatic Reference Counting SET YES If you need to remove ARC then Go to Project->Build Phases->compile sources then find your file Which you need to remove ARC then set compile source '-fno-objc-arc'
在xcode的顶部
编辑 – >重构 – >然后select转换为弧
尝试这个
希望这将解决您的问题..
编辑→重构→转换为Objective-C ARC。
以下是关于如何处理任何迁移问题的文档: