First step: Add the Assetslibrary.framework framework
Second step: Need to use the class inside the import header file #import <AssetsLibrary/AssetsLibrary.h>
The third step: Save the network picture to the local
- (void) viewdidload{ [super viewdidload]; uiimage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL urlwithstring:@ "Http://pic25.nipic.com/20121209/9252150_194258033000_2.jpg"]]]; [self saveImage:image]; }- (void) SaveImage: (uiimage*) image{ ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeimagetosavedphotosalbum:[image cgimage] orientation: (ALAssetOrientation) image.imageorientation completionblock:^ (Nsurl *asseturl, nserror *error) { if (Error) { nslog (@ "save image fail:%@", error); }else{ &nbSp; nslog (@ "save image succeed."); } }];}
IOS uses alassetslibrary to save pictures to local