簡體   English   中英

從未調用過UINavigationController deinit

[英]UINavigationController deinit never called

從我的UINavigationController堆棧的一些ViewController ,我提供了另一個ViewController ,它將永遠不會回來,但是問題是未調用deinit{} 導航之前,應如何從堆棧中刪除每個ViewController 還是應該使用其他方法? 現在我的代碼看起來像

let destinationVC = storyboard?.instantiateViewControllerWithIdentifier("revealViewController") as! SWRevealViewController
self.presentViewController(destinationVC, animated: true, completion: nil)

首先,當你調用presentViewController:animated:completion:你會出現新viewController 模態 ,在外面navigationController's層次。

如果您希望將其顯示在navigationController層次結構中,請使用:

self.navigationController!.pushViewController(destinationVC, animated: true)

而且,如果您想更改視圖層次結構,則navigationController具有viewControllers屬性,可以設置是否帶有animation

self.navigationController!.setViewControllers([destinationVC],
           animated: true)

有關更多信息,請參見iOS開發者庫

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM