开发者

Objective-C class to load images asynchronously

What are the best classes with which I might asynchronously load开发者_运维问答 images in Objective-C?


This is my stab at it: https://github.com/Koolistov/Image-Cache


I found this one the best > HJCache.


If you're loading them from disk, just check out the UIImage api:

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html

... for example:

[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:FILENAME_WITHOUT_EXTENTION ofType:@"png"]];

if you're loading images from the network, I like using the ASIHTTPRequest (also supports Queues) API. Check it out here:

http://allseeing-i.com/ASIHTTPRequest/How-to-use


How about just using NSURLConnection with an URL for the file (either a file or http URL)?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜