[UIImageView setImageWithURL:]: unrecognized selector sent to instance解决办法
来源:互联网 发布:身份证借人开淘宝好吗 编辑:程序博客网 时间:2024/05/19 23:27
Common Problems
Using dynamic image size with UITableViewCell
UITableView determins the size of the image by the first image set for a cell. If your remote images don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue. The following article gives a way to workaround this issue:
http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/
Automatic Reference Counting (ARC)
You can use either style in your Cocoa project. SDWebImage Will figure out which you are using at compile time and do the right thing.
Installation
There are two ways to use this in your project: copy all the files into your project, or import the project as a static library.
Add the SDWebImage project to your project
Right-click on the project navigator and select "Add Files to "Your Project":
In the dialog, select SDWebImage.xcodeproj:
After you’ve added the subproject, it’ll appear below the main project in Xcode’s Navigator tree:
You may want to add the SDWebImage directory in your project source tree as a submodule before adding it to your project.
Add build target dependencies
In you application project app’s target settings, find the "Build Phases" section and open the "Target Dependencies" block:
Click the "+" button and select "SDWebImage ARC" (you may choose the non ARC target if you want to support iOS <3 or the ARC+MKAnnotation if you need MapKit category):
Open the "Link Binary With Libraries" block:
Click the "+" button and select "libSDWebImageARC.a" library (use non ARC version if you chose non ARC version in the previous step):
Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature:
If you chose to link against the ARC+MKAnnotation target, click the "+" button again and select "MapKit.framework":
Add headers
Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag:
In the "Search Paths" section, locate "Header Search Paths" (and not "User Header Search Paths") and add two settings:”$(TARGET_BUILD_DIR)/usr/local/lib/include”
and ”$(OBJROOT)/UninstalledProducts/include”
. Double click on the<Multiple values>
to pop out the box and click on the "+" icon to add each of them. Make sure to include the quotes here:
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>
Build Project
At this point your workspace should build without error. If you are having problem, post to the Issue and the community can help you solve it.
Fixing indexing
If you have problem with auto-completion of SDWebImage methods, you may have to copy the header files in your project.
Future Enhancements
- LRU memory cache cleanup instead of reset on memory warning
转自:https://github.com/rs/SDWebImage#installation
- [UIImageView setImageWithURL:]: unrecognized selector sent to instance解决办法
- -[UIImageView _isResizable]: unrecognized selector sent to instance
- unrecognized selector sent to instance 解决办法
- [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance
- [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- unrecognized selector sent to instance
- tableview 出现unrecognized selector sent to instance的解决办法
- NSString category:unrecognized selector sent to instance
- 关于phpamin导入导出大数据的经验
- 浏览器与社交成智能机时代重要入口
- 七夕·殇
- Json序列化与反序列化
- Write Local Image with AIR
- [UIImageView setImageWithURL:]: unrecognized selector sent to instance解决办法
- 代码操作注意事项,否则哭都没有地方啊!
- ibatis报错之别名重复
- Riak Object 结构
- 风尘中,忘了捡拾那日女子留下的胭脂
- WinServiceTask 任务调度,也可以用于ASP.NET实现自动服务
- Intel展示SoC化的Atom芯片 集成Wi-Fi模块
- DevExpress GridControl 使用2
- 与圆角listview类似的效果