我有一个UITabViewController,负责管理多个视图(和导航控制器)。这些视图是通过在Storyboard中Ctrl单击UITabViewController并选择“关系segue”连接到其他视图的。
问题是,在UITabViewController中prepareForSegue根本没有触发。代码中没有做任何其他更改。点击选项卡栏切换视图时,NSLog不会输出任何内容。
CustomTabViewController.m
问题是,在UITabViewController中prepareForSegue根本没有触发。代码中没有做任何其他更改。点击选项卡栏切换视图时,NSLog不会输出任何内容。
CustomTabViewController.m
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
NSLog(@"Here..");
NSLog(@"%@", [segue destinationViewController]);
}
有人知道为什么会发生这种情况吗?谢谢
UITabBarControllerDelegate
后,我能够实现tabBarController:didSelectViewController:
并在那里进行初始化。 - kfmfe04