注意保存图片引用的images不能是autorelease的
- (void) saveImagesToPhotosAlbum:(NSMutableSet *)images { if (images.count == 0) { [images release]; return; } UIImage *image = [[[images anyObject] retain] autorelease]; [images removeObject:image]; UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), images); } - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { [self saveImagesToPhotosAlbum:(NSMutableSet *)contextInfo]; }