我创建了一个应用程序并有“图库”按钮,我想在按下该按钮时可以看到 Ipad 照片库中的所有图像。我的代码在这里:
- (IBAction)btGallery:(id)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
if(popoverController == nil)
{
popoverController = [[UIPopoverController alloc] initWithContentViewController:picker];
}
popoverController.delegate = self;
[popoverController presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
但是当我按下那个按钮时,我什么都看不到……请帮帮我!