【发布时间】:2016-06-15 08:29:58
【问题描述】:
我正在使用MZFormSheetPresentationController 将 ViewController2(按照建议嵌入到导航控制器中)显示为“弹出”,而不是 ViewController1。
我的 ViewController1 有一个搜索栏、一个 UISegmentedControl 和一个表格视图:
当用户单击搜索栏书签按钮时,会显示弹出窗口。
我想在用户单击完成按钮时关闭弹出窗口,并且使用 self.dismissViewControllerAnimated(true, completion: nil) 方法效果很好,但我正在寻找更多.我想再次展示 ViewController1,以便 tableView 重新加载数据。 我试过了:
self.dismissViewControllerAnimated(true, completion: nil)
print("Dismissed")
//goToTickets
let next = self.storyboard?.instantiateViewControllerWithIdentifier("myTabBar") as! UITabBarController
self.presentViewController(next, animated: true, completion: nil)
但我收到此错误:
警告:尝试呈现不在窗口层次结构中的视图!
弹出窗口消失,但我无法呈现 ViewController。
我该怎么办?
提前致谢。
编辑
这是我的 ViewController2,标识符为“navigationFilter”
还有我的标签栏:
【问题讨论】:
标签: ios swift uiview tableview uisegmentedcontrol