您是否检查
prepareForSegue过TabBarController中的是否曾经被调用?
永远不会调用它,因为a
UITabBarController及其子视图控制器之间的连接不是情节提要。您应该
UITabBarController通过
viewControllers在所需索引处访问viewController的集合来直接从viewController获得对其的引用。
var tabBarController = segue.destination as UITabBarControllervar destinationViewController = tabBarController.viewControllers[0] as YourViewController // or whatever tab index you're trying to accessdestination.property = "some value"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)