我打開導航控制器,使用故事板中的直接導航segue或從代碼中調用segue,但仍在故事板上創建。如何正確關閉模態呈現的控制器
實施例:
self.performSegue(withIdentifier: "addNew", sender: nil)
然後與模態過渡打開navigationController。 NC然後有幾個視圖控制器上都對他們關閉按鈕,當我點擊它,它使用關閉NC:
self.navigationController?.dismiss(animated: true, completion: nil)
但後來當我在TabbarController不同ViewControllers之間切換或打開與推動一些其他視圖查看我得到:
Unbalanced calls to begin/end appearance transitions for
還viewWillAppear上打開的視圖不會被調用。所以任何人都可以告訴我,如果我正確關閉NC或者有其他方法來防止錯誤。
EDIT1: 從 改變了收盤集合競價controller.navigationController .dismiss?(動畫:真,完成:無)
到self.navigationController .dismiss?(動畫:真,完成:無)剛使問題更容易。
還累:
self.dismiss(animated: true, completion:nil)
EDIT2: 是它可能是錯誤的,打開從VC數控是數控是對的UITabBarController或只是簡單地本來就不好有NavigationControllers作爲TabbarController標籤?
'self.navigationContro ...... [「不平衡調用的' –
可能的複製DetailViewController「開始/結束外觀轉換」時推送多個詳細信息視圖控制器](http://stackoverflow.com/questions/9088465/unbalanced-calls-to-begin-end-appearance-transitions-for-detailviewcontroller) –
@奧列格戈迪丘克不這麼認爲,辛格e如果我從未打電話給其他NC,那麼不會出現問題 – schmru