【发布时间】:2016-04-06 17:44:23
【问题描述】:
您好,我想将值传递给我的第二个 Controller。第二个 Controller 连接到 NavigationController,并且情节提要 Id 已在 NavigationController 中设置,而不是在 SecondViewController 中
我这样展示 ViewControllers
var _profile : UINavigationController{
get{
return self.storyboard?.instantiateViewControllerWithIdentifier("ShowUserProfileTableViewController") as! UINavigationController
}
}
case 0:
if (self.revealViewController().frontViewController.isKindOfClass(UINavigationController)){
let nav : UINavigationController = self.revealViewController().frontViewController as! UINavigationController
if (!nav.viewControllers[0].isKindOfClass(ShowUserProfileTableViewController)){
self.revealViewController().setFrontViewController(self._profile, animated: true)
}
}
else{
self.revealViewController().setFrontViewController(self._profile, animated: true)
}
break
【问题讨论】:
-
您是否尝试过 prepareForSegue 功能?
-
不,我想在这个函数中传递参数。我写的代码? @ctabuyo
-
我不明白您的问题 - 您遇到的具体问题是什么?错误信息是什么?为什么
prepareForSegue:sender:不做你想做的事?您是否在 StackOverflow 上搜索过以前的类似问题 (stackoverflow.com/q/7864371/558933)? -
每次访问 (get)
_profile时,都会创建一个新实例。
标签: ios swift uinavigationcontroller