[英]how to add ARC in between of project
我正在创建iPhone应用程序,并且在这之间我需要使用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.
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 4.6,然后选择目标Target
- > Build Settings
,找到苹果LLVM编译器4.2参见本节中,如果Objective-C中自动引用计数设置为YES,如果不是那么只需将它设置为YES。 对于较旧版本的XCode,您可以更改为Apple LLVM compiler 3.0
在xcode顶部
编辑->重构->然后选择转换为弧
尝试这个
希望这能解决您的问题。
编辑→重构→转换为Objective-C ARC。
以下是有关如何处理任何迁移问题的文档:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.