1

我正在创建 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标志?

4

6 回答 6

3
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.
于 2013-03-18T11:50:39.990 回答
1
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' 
于 2013-03-18T11:52:11.347 回答
1

如果您使用的是 xcode 4.6,则选择您的目标Target->Build Settings并找到Apple LLVM 编译器 4.2 ,如果Objective-c Automatic Reference Counting设置为YES ,请参见本节,如果不是,则将其设置为 YES。对于旧版本的 XCode,您可以更改为Apple LLVM compiler 3.0

于 2013-03-18T11:54:10.653 回答
0

在 xcode 顶部

编辑->重构->然后选择转换为 Arc

于 2013-03-18T11:50:14.887 回答
0

试试这个如图所示查看图像添加 -fobjc-arc flag flag-

希望这能解决你的问题..

于 2013-03-18T11:53:42.680 回答
0

编辑 → 重构 → 转换为 Objective-C ARC。

以下是有关如何处理任何迁移问题的文档:

http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

于 2013-03-18T11:53:54.637 回答