Fahim Parkar
Fahim Parkar

Reputation: 31647

how to add ARC in between of project

I am creating iPhone app and in between I need to use SDWebImage. For this I need to use ARC.

Any idea how to add ARC in between in project?

Note: In one file I have below content.

#if !__has_feature(objc_arc)
#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
#endif

Where should I add -fobjc-arc flag?

Upvotes: 1

Views: 600

Answers (6)

Hemant Dixit
Hemant Dixit

Reputation: 1145

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' 

Upvotes: 1

nsgulliver
nsgulliver

Reputation: 12671

If you are using xcode 4.6 then Select your target Target->Build Settingsand find Apple LLVM compiler 4.2 see in this section if Objective-c Automatic Reference Counting is set to YES, if not then just set it to YES. For older version of XCode you could change for Apple LLVM compiler 3.0

Upvotes: 1

iPatel
iPatel

Reputation: 47099

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.

Upvotes: 3

eyebrowsoffire
eyebrowsoffire

Reputation: 947

Edit → Refactor → Convert to Objective-C ARC.

Here’s the documentation on how to deal with any migration issues:

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

Upvotes: 0

iAppDeveloper
iAppDeveloper

Reputation: 1088

try thislook into the image as shown add -fobjc-arc flag flag-

hope this will solve your prob..

Upvotes: 0

JPiOS
JPiOS

Reputation: 86

In top of xcode

edit->refactor->then chose convert to Arc

Upvotes: 0

Related Questions