6
从IOS上的UIView将图像保存到应用程序文档文件夹
我有一个UIImageView,它允许用户放置并保存图像,直到可以保存为止。问题是,我不知道如何实际保存和检索放置在视图中的图像。 我已经将图像检索并放置在UIImageView中,如下所示: //Get Image - (void) getPicture:(id)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = YES; picker.sourceType = (sender == myPic) ? UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypeSavedPhotosAlbum; [self presentModalViewController:picker animated:YES]; [picker release]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage (UIImage *)image editingInfo:(NSDictionary *)editingInfo { myPic.image = image; [picker dismissModalViewControllerAnimated:YES]; } …