Sdwebimage: UIImageView + WebCache.h: No such file or directory

I'm new to ios development - trying to use sdwebimage in my iphone project. In my opinion, I completed all the basic settings as needed. But when I create, I get this error: there is no such file or directory next to this line:

#import "UIImageView+WebCache.h" 
  • Yes, I added target dependencies
  • I added libSDWebImage.a to Link Binary With Libraries.
  • I have -all_load -ObjC in other linker flags
  • I also tried -force_load $ {BUILT_PRODUCTS_DIR} /libSDWebImage.a (64 bit mac)
  • My usage header search paths: $ (BUILT_PRODUCTS_DIR)
  • I cleaned up the project and rebuilt - but did not use it.

Assembly continues. Again, code completion Xcode4 โ€œresolvesโ€ when I type โ€œimportโ€ UI and press โ€œCtrl + spaceโ€, which means lib is visible to xcode. Any pointers would be very helpful. Thank.

+3
import iphone installation xcode sdwebimage
Jan 28 2018-12-12T00:
source share
7 answers

To add the necessary header files to the build path

  • Select project file
  • Choose a target
  • Select Build Settings
  • In the search box, enter "heading search paths"
  • To release, add "$(SOURCE_ROOT)/SDWebImage" (these are quotation marks).

This will work when importing #import <SDWebImage/UIImageView+WebCache.h>

+15
May 22 '12 at 3:51 am
source share

I also use SDWebImage .
In my experience, I haven't done anything with linker flags, etc.
You only need to add the classes to your project and simply import the header "UIImageView + WebCache.h" in the header of your class as follows:

 #import "UIImageView+WebCache.h" 

and if you want to use it in a UIImageView object, just use the method

 setImageWithURL:placeholderImage: 

you can refer to their github for more information

+8
Jan 28 2018-12-12T00:
source share

I just ran into this problem and solved it.

The problem is that when you drag the xcode SDWebImage project into your project, Xcode only creates a link pointing to the files you need. When you are in debug mode, this is great, he knows where to find this file. However, when you want to archive it (packaging everything to be autonomous), it could not find it from your search path.

Although you added $ (BUILT_PRODUCTS_DIR) to your search path, but if the files you actually downloaded are not physically located in your $ (BUILT_PRODUCTS_DIR), then Xcode will not find them. This was a problem for me, since the SDWebImage files were still sitting in my download folder.

What do you want to do:

1. Move the SDWebImage folders to a place where you do not accidentally delete it. Please note that once you have done this, the SDWebImage project file will turn red, as its physical location moves. And he connected to the fact that I could not delete this link in Xcode, what I ended up added this file again (choosing from where I just move it). You will receive a red SDWebImage.xcodeproj in your project navigator, which you cannot delete. This is very annoying, but it will not affect anything. 2. If the location where you are moving the SDWebImage material is not in your $ (BUILT_PRODUCTS_DIR), then you either move it inside $ (BUILT_PRODUCTS_DIR), or like me, add the path to Target โ†’ Assembly Settings โ†’ Search Paths โ†’ Title Search Paths user.

Archive, and it should work now.

+3
Mar 15 '12 at 8:22
source share

I ran into the same problem and was going to go crazy. Like Ravi, I followed the instructions for static installation as close as possible.

I saw the auto hint for UIImageView+WebCache.h when I typed #import , but it keeps throwing the file was not found.

In the end it was. In the header search path ,

"$(BUILT_PRODUCTS_DIR)" - Incorrect.

$(BUILT_PRODUCTS_DIR) - That's right.

Confused, but now it works correctly =)

+1
Feb 15 2018-12-12T00:
source share

I dealt with this problem for the last hour and noticed something that was not mentioned: make sure that when you update the search paths for the update headers that are selected as the "Recursive" parameter! Otherwise, the compiler will not check subfolders.

Worked for me ...

+1
Apr 30 '13 at 10:09
source share

I was dealing with the same problem, my two structures were not found. I tried all the suggested methods to resolve the error, but that did not help. Atlast, I removed the frameworks from my project structure and reloaded them from the project source file, and it will work! Please try if this helps, it worked for me ...

0
Feb 07 '14 at 13:46 on
source share

I had a similar problem after updating pod. If you are using CocoaPods version higher than 1.0.0 and more than one goal in your project, you need to add all goals to the subfile.

0
Jan 23 '17 at 9:55 on
source share



All Articles