【发布时间】:2012-05-01 18:32:59
【问题描述】:
我对模型和保存数据仍然有些困惑,也许有人可以帮助我。我有一个页面,用户可以在其中从相机胶卷导入照片。当我转到下一页时,它又消失了。我可以将文本数据保存在文本框中的 NString 中,但我不确定如何使用图像执行此操作。图像显示在 UI webview 中。
xcode 4.3
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
}
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
【问题讨论】: