我在用着
UIImage *viewImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageURL]]];
NSLog(@"UIImage : %@",viewImage);
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library writeImageToSavedPhotosAlbum:[viewImage CGImage] orientation:(ALAssetOrientation)[viewImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){
if (error) {
NSLog(@"error");
} else {
NSLog(@"URL IS %@", assetURL);
[self assignDictonary:viewImage withURL:assetURL withMediaType:@"public.image"];
}
}];
[library release];
或者
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,(unsigned long)NULL), ^(void) {
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageURL]]], self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
});
要保存图像..
它适用于 iOS 5 以上的所有版本...
它不适用于 iOS 4.3...
为什么会这样..任何人都可以建议我一些其他的解决方案..