第一种方法:
//从网络上下载图片
NSString*qrCodeURL=[NSStringstringWithFormat:@"http://api.fanggw.cn/index.php/Mobile/Index/get_qrcode?mobile=%@&pwd=%@",phone,secret];
NSURL*url=[NSURLURLWithString:qrCodeURL];
[_qrCodeImagesd_setImageWithURL:urlcompleted:^(UIImage*image,NSError*error,SDImageCacheType cacheType,NSURL*imageURL){
}];
第二种方法:
NSURL*url =[NSURL URLWithString:qrCodeURL];
NSData*data=[NSData dataWithContentsOfURL:url];
UIImage*image =nil;
image=[UIImageimageWithData:data];
_qrCodeImage.image= image;