是否可以从我的应用启动(重定向用户)iphone的原生照片库应用程序,类似于电子邮件?现在可以在4.2 sdk中使用吗?
答案 0 :(得分:6)
为此,您必须创建并呈现UIImagePickerController
,如下所示:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePicker animated:YES];
如果您希望用户改用相机,可以将imagePicker.sourceType
更改为imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
。
委托方法:- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
将为您提供info
词典中的图片。