2015-11-16 21 views
0

目前我正試圖通過點擊UIBarButtonItem來解僱彈窗視圖控制器。新的iOS已經棄用了舊的做法,我無法找到任何有關如何使用iOS 9的方法。我目前通過segues添加了popover。如何通過UIBarButtonItem關閉iOS9中的彈出視圖?

- (IBAction)backButtonAction:(id)sender { 
    buttonCount++; 
    if (buttonCount == 1) { 
     [self dismissViewControllerAnimated:YES completion:nil]; 
    } 
    buttonCount = 0; 
} 
+2

顯示你的代碼請,如果你不介意。 – VRAwesome

+0

- (IBAction)backButtonAction:(id)sender {buttonCount ++; 如果(buttonCount == 1){ [自dismissViewControllerAnimated:YES完成:無]; } buttonCount = 0; } – Lozo

+0

這是我的代碼,我放在我的視圖中,充當popover – Lozo

回答

0

UIPopoverController有一個神奇的功能dismissPopoverAnimated:,你怎麼稱呼它駁回酥料餅。祝你好運!

相關問題