I\'m trying to use SDWebImage in my iPhone app. I followed the step by step tutorial to install SDWebImage into my Xcode project.
When I try to build my app i\'m ge
Using #import <SDWebImage/UIImageView+WebCache.h>
fixed the issue for me as I was using Cocoapods as frameworks (use_frameworks!).
A much cleaner "install" of SDWebImage would be as follow:
On any .m file where you wish to use it add:
#import "UIImageView+WebCache.h"
(and any other SD component needed)
instead of what you probably did:
#import <SDWebImage/UIImageView+WebCache.h>
this does not require any project header manipulation and will work as is.
I was also getting this problem. Solution for me was to add SDWebImage.framework, instead of adding all files in my project. Here is the check list to make sure everything is setup as suggested by auther here.
Download and Add framework
Step 1: Download and unzip the lastest version here: https://github.com/rs/SDWebImage/wiki/Download-Complied-Framework
Step 2: Right-click on the project navigator and select "Add Files to "Your Project": In the dialog, select SDWebImage.framework, and 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"
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
#import <SDWebImage/UIImageView+WebCache.h>
It should build now without any problem.
Check if you have linked the file correctly and its in your bundle or not.
I got this error when I was removing some old unused Pods while keeping the XCode open. I have seen and read that you must keep XCode closed while doing any pod operation. Once pod operation is done, you should then reopen xcworkspace file and build.
Did the same closed the XCode, but also I removed the contents of Derived data just to start from a fresh page. It worked !
The @Lizard answer saved my day!
$(SRCROOT)/SDWebImage to Header Search Path
Just to be more specific, you have to add that configuration in your target and not in the project view.