[英]Objective-C class to load images asynchronously
What are the best classes with which I might asynchronously load images in Objective-C?我可以在 Objective-C 中异步加载图像的最佳类是什么?
This is my stab at it: https://github.com/Koolistov/Image-Cache这是我的尝试: https://github.com/Koolistov/Image-Cache
If you're loading them from disk, just check out the UIImage api:如果您从磁盘加载它们,只需查看 UIImage api:
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html 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.如果您从网络加载图像,我喜欢使用 ASIHTTPRequest(也支持队列)API。 Check it out here:
在这里查看:
http://allseeing-i.com/ASIHTTPRequest/How-to-use 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)?将 NSURLConnection 与 URL 一起用于文件(文件或 http URL)怎么样?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.