因此,在我选择图像后的iPhone 4设备中,我希望图像选择器弹出窗口消失。以下代码适用于iOS 5上的iPad 3,iOS 6上的iPad 4,iOS 5上的iPhone 4但以下代码对iOS 6上的iPhone 5不起作用。为什么会这样?
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self loadImage:[info objectForKey:UIImagePickerControllerOriginalImage]];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) {
if ([popoverController isPopoverVisible]) {
// called for iPad
[popoverController dismissPopoverAnimated:YES];
}
}
else {
// called for iPhone
[self dismissModalViewControllerAnimated:YES]; <== NOT WORKING
[self dismissViewControllerAnimated:YES completion:nil]; <== ALSO NOT WORKING
}
答案 0 :(得分:0)
看起来你正在告诉代表图像选择器(自我)被解雇,而不是图像选择器本身。