我image picker
在 iPad 上创建了一个弹出框。此功能有效。但是,如果您按UIBarButton
两次应用程序崩溃。
@property (retain) UIPopoverController *popoverController1;
-(IBAction)photos:(id)sender {
test = false;
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.wantsFullScreenLayout = NO;
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = YES;
self.popoverController1 = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
_popoverController1.delegate = self;
[_popoverController1 setPopoverContentSize:CGSizeMake(1024, 500)];
[self.popoverController1 presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
你有什么建议吗?