开发者

Objective-C class to load images asynchronously

开发者 https://www.devze.com 2023-03-28 06:32 出处:网络
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-CacheI found this one the best > HJCache

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

精彩评论

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