本文介绍了sdwebimage:UIImageView + WebCache.h:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ios开发的新手 - 尝试在我的iphone项目中使用sdwebimage。我相信我已按要求完成了所有基本设置。但是当我构建时,我收到此错误:此行附近没有此类文件或目录:

I am fairly new to ios development - trying to use sdwebimage in my iphone project. I believe I completed all basic setups as required. But when I build, I get this error: No such file file or directory near this line:

#import "UIImageView+WebCache.h"




  • 是的,我添加了目标依赖项

  • 我在Link Binary with Libraries中添加了libSDWebImage.a

  • 我在其他链接器标志中有-all_load -ObjC

  • I还尝试了-force_load $ {BUILT_PRODUCTS_DIR} /libSDWebImage.a(64位mac)

  • 我的使用标题搜索路径是:$(BUILT_PRODUCTS_DIR)

  • 我清理了项目并重建了 - 但没有用。

    • Yes I have added Target Dependencies
    • I have added libSDWebImage.a in Link Binary With Libraries
    • I have -all_load -ObjC in Other Linker Flags
    • I also tried the -force_load ${BUILT_PRODUCTS_DIR}/libSDWebImage.a (64bit mac)
    • My Use Header Search Paths is : $(BUILT_PRODUCTS_DIR)
    • I cleaned the project and rebuilt - but no use.
    • 构建不断失败。再次,当我输入#importUI& hitctrl + space时,XCode4代码完成解析,这意味着lib对xcode是可见的。任何指针都会非常有用。谢谢。

      Build keeps failing. Again, XCode4 code completion "resolves" when I type #import "UI & hit "ctrl+space" which means the lib is visible to xcode. Any pointers will be super helpful. Thanks.

      推荐答案

      要将所需的头文件添加到构建路径,请执行以下操作。

      To add the needed header files to the build path do the following.


      1. 选择项目文件

      2. 选择目标

      3. 选择构建设置

      4. 在搜索框中输入'标题搜索路径'

      5. 对于Release,添加$(SOURCE_ROOT)/ SDWebImage(带引号)。

      1. Select your project file
      2. Select your target
      3. Select Build settings
      4. In the search box enter 'header search paths'
      5. For the Release add "$(SOURCE_ROOT)/SDWebImage" (thats with quotes).

      这样在导入时会起作用 #import< SDWebImage / UIImageView + WebCache.h>

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

      这篇关于sdwebimage:UIImageView + WebCache.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 17:51