ios-UIImage写入相册

 NSData *imagedate=UIImagePNGRepresentation(image);//将相片转化成data,当然再这里和主题无关
 NSLog(@"%d",imagedate.length);//返回的是字节数
 UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), @"liyang");//这个方法的作用是写到相册里面,下面那个是回调方法
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
    NSLog(@"%@",error);
    NSLog(@"%@",contextInfo);
}

 

posted @ 2014-04-15 23:26  离子  阅读(559)  评论(0编辑  收藏  举报