2012-06-01 36 views
1

我的應用程序在較舊的操作系統上運行良好,但在5.1.1(在iPad2和新iPad上測試)彈出窗口顯示,運行良好,但不會在用戶點擊彈出窗口時關閉。我不使用任何解僱代碼或按鈕。我使用iOS 5.0 SDK,XCode 4.2來編譯應用程序。這是我展示它的方式。任何想法可能是錯的?iOS 5.1.1 Popover不會自動解僱

- (void)showNotifications { 

    NotificationsViewController *vc = [[[NotificationsViewController alloc] init] autorelease]; 
    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 

    if ([UIApplication isIPad]) { 

     vc.modalInPopover = YES; 
     self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:vc] autorelease]; 

     [self.popoverController presentPopoverFromRect:bottomView.frame inView:[bottomView superview] permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; 

    } 
    else 
     [self presentModalViewController:vc animated:YES]; 

} 

回答

1

神祕解決了。只是註釋掉行

//vc.modalInPopover = YES; must be no on iOS 5 

ModalInPopover一定是假的在iOS 5不知道,如果它仍然在iOS 4的工作雖然。