我尝试使用 iOS6 实现从 iPad 中的照片库中挑选图像的代码,但它不起作用。我尝试的代码如下所示。
UIImagePickerController *imagePickerController=[[UIImagePickerController alloc] init];
imagePickerController.delegate=self;
UIPopoverController *popover=[[UIPopoverController alloc] initWithContentViewController:imagePickerController];
popover.delegate=self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {
imagePickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[popover presentPopoverFromRect:CGRectMake(400, 400, 0, 0) inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
谁能告诉我这个问题的解决方案。
任何帮助将不胜感激