I am trying to use SDWebImage in an IOS project.
I am following these instructions from their github:
import the project as a static library.
Add the SDWebImage project to your project
Download and unzip the last version of the framework from the download page
Right-click on the project navigator and select "Add Files to "Your Project":
In the dialog, select SDWebImage.framework:
Check the "Copy items into destination group's folder (if needed)" checkbox
Add dependencies
In you application project app’s target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block:
Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature:
Add Linker Flag
Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag:
Import headers in your source files
In the source files where you need to use the library, import the header file:
#import <SDWebImage/UIImageView+WebCache.h>
But I am getting this error:
SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc
I have tried to search for header search paths that some other answers say and I get these results:
Always search user paths -No
Header search paths
User header search paths
Must I set a value there? Or should I do anything else?
Another thing that i noticed in their demo is that: in their demo, in the frameworks folder they have imported the .xcodeproject of sdwebimageview and I have imported sdwebimageview.framework as the instructions say in the github.
Thanks!
Edit: my project is non-Arc.
I tried changing the other Linker flags from -ObjC to fobjc-arc
but I still get the same error.
1)was that correct or should I change something else? 2) if I change my project from non-arc to arc what should I change? I only want to use that library so I prefer not change it.
In the .h file os SDWebImage it says:
#if !__has_feature(objc_arc)
#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
#endif