0
因此,在我選擇圖像後,我的iPhone 4設備中圖像選擇器彈出消失。以下代碼適用於iOS 5上的iPad 3,iOS 6上的iPad 4,iOS 5上的iPhone 4,但以下代碼對iOS 6上的iPhone 5無效。爲什麼會這樣?dismissViewControllerAnimated:完成:不適用於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
}