IT虾米网

Objective-C从远程地址下载图片

sanshao 2018年06月23日 手机开发 1030 0
- (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; 
}

评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

iOS 自定义瀑布流相册控件