【发布时间】:2014-11-03 08:37:01
【问题描述】:
我对 iOS 中的导航视图控制器和堆栈相当陌生。请帮我解决这个问题,尝试搜索了很长时间没有找到任何相关的内容。
我有一个 LoginViewController、一个用于侧边菜单操作的 SWRevealViewController、一个 FirstViewController(导航堆栈中的第一个)和一个 SecondViewController(导航堆栈中的第二个)。
我必须在 LoginViewController 中执行以下操作,假设 login 和 found 是两个布尔变量:
if (login && !found) {
//redirect to FirstViewController : the following works
[self presentViewController:swReveal animated:NO completion:nil];
}
else if (login && found) {
//redirect to SecondViewController
}
请帮我填写 else if。非常感谢您的宝贵时间!
【问题讨论】:
-
那么,您实际在哪里使用 FirstViewController,如果您不展示它,为什么需要它?也许包括你的故事板的截图,让你的要求更清楚。
-
如果我找到的变量为假,我需要 FirstViewController。具体的应用是如果手机在附近发现了一个beacon然后found=YES,那么就重定向到SecondViewController。 SecondViewController 是 FirstViewController 的一个 DetailView Cell,它是一个 tableView。
标签: ios xcode uiviewcontroller uinavigationcontroller uinavigationitem