0

我正在开发一个应用程序,该应用程序允许用户从他自己的相册中选择图像。它适用于 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 ];

    }
}
4

1 回答 1

5

检查你的.h文件。确保 your @propertyfor your popoverControllerisstrong而不是weak. 很多小时的时间都浪费在这样简单的事情上了。

于 2013-03-12T22:19:17.863 回答