我正在使用此代码使用 imagepicker 打开一个弹出窗口
-(IBAction)photosAction:(id)sender
{
// dismiss any left over popovers here
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker];
self.popoverController = popover;
popoverController.delegate = self;
[popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
[picker release];
但这会导致对成员“popoverController”的此错误请求不是结构或联合,并且此错误“popoverController”未声明(在此函数中首次使用)。
我还想在选择图像时关闭弹出框。
选择图像后,我应该在以下函数中输入什么代码来关闭弹出框。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
谢谢您的帮助!