从iphone应用程序启动照片库

从iphone应用程序启动照片库,iphone,gallery,photo,launch,Iphone,Gallery,Photo,Launch,是否可以从我的应用程序启动(将用户重定向到)iphone的本机照片库应用程序,类似于电子邮件?现在在4.2 sdk中是否可以这样做?为此,您必须创建并呈现一个UIImagePickerController,如下所示: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.allowsEditing = YES;

是否可以从我的应用程序启动(将用户重定向到)iphone的本机照片库应用程序,类似于电子邮件?现在在4.2 sdk中是否可以这样做?

为此,您必须创建并呈现一个
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 did finishpickingMediaWithInfo:(NSDictionary*)info
将为您提供
info
字典中的图像

我不知道是哪个例子,但你可以在自己的应用程序中显示照片应用程序中的照片。检查苹果的示例代码。你找到解决方案了吗?谢谢你的回复。我想启动本机iphone应用程序照片库,而不是简单地从照片库中挑选图像,我想知道这是可能的w/最新的SDKI不知道任何API使启动照片应用程序成为可能。以下是可使用自定义URL方案启动的应用程序列表: