我有一个 UIView 子类,如果点击其中的按钮,它必须将 viewController 推送到导航堆栈上。所以我在我的 appDelegate 中保留了导航 Controller 的副本。然后我从按钮的操作方法中执行以下操作:
[appDelegate.navigationController pushViewController:nextViewController animated:YES];
这会导致应用程序在 nextViewController 弹出时崩溃。当我按照更标准的方法从 UIView 子类发布通知、在父 View Controller 中接收它并从那里推送 nextViewController 时,此问题已得到解决。
为什么会这样?
最佳答案
[self.navigationController pushViewController:nextViewController animated:YES];
试过这个代码....
关于ios - 从 UIView 子类推送导航 Controller 会导致崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20545138/