uiimage 加载远程图片

来源:互联网 发布:淘宝浙江哈尔斯保温杯 编辑:程序博客网 时间:2024/04/27 16:29
本地加载图片可以用这个:

[UIImage imageWithContentsOfFile:headPath];


但如果我们想直接跟上网址加载远程图片的话可以用这个:

NSURL *url = [NSURLURLWithString:@"http://www.ganchi.net//images/avatar_small/1330587370_small.jpg"];

return  [UIImageimageWithData:[NSDatadataWithContentsOfURL:url]];


原创粉丝点击