本文給大家分享了2則使用Objective C從遠程url下載圖片的方法,都是個人項目中使用的,匯總下推薦給大家,有需要的小伙伴可以參考下。
Objective C從遠程url下載圖片
?
1 2 3 4 5 6 7 8 - (UIImage *) getImageFromURL: (NSString *)theURL { UIImage *theImage = NULL; NSString *imageFileName = [BT_strings getFileNameFromURL:theURL]; NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:theURL]]; theImage = [[UIImage alloc] initWithData:imageData]; [BT_fileManager saveImageToFile:theImage fileName:imageFileName]; return theImage; }objective C從遠程地址獲取圖片并修改尺寸
?
以上所述就是本文的全部內容了,希望大家能夠喜歡。
新聞熱點
疑難解答