【发布时间】:2013-03-12 22:16:05
【问题描述】:
我正在开发一个应用程序,该应用程序允许用户从他自己的相册中选择图像。它适用于 iPhone,但不适用于 iPad。
我做了一个UIPopoverController,一切正常,用户可以选择一张照片,但是当用户按下“使用”按钮时。该应用兑现说
UIPopoverController dealloc] 在 popover 仍然可见时到达
代码如下:
- (void)choosePhotoFromLibraryipad:(id)sender{
if(![popoverController isPopoverVisible]){
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[self.popoverController presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 400.0)
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES ];
}
}
【问题讨论】:
-
当你想隐藏popover时,你写过
[popoverController dismissPopoverAnimated:YES];吗?请说明您是否使用ARC? -
是的,我忘了做一个 [popoverController dismissPopoverAnimated:YES];尴尬 :-D 经过这么多小时,就这么简单
标签: ios ipad uipopovercontroller popover