嗨,我是 iphone 开发的新手,正在使用故事板做我的项目,在我的项目中,我有登录 viewController,如果登录成功,它将转到 tabbarcontroller。在 tabbarController 中,它具有三个 viewController。在 tabbarController 和三个视图控制器之间我有一个导航控制器。现在的问题是我必须将数据从 loginviewController 传递到 tabBarcontroller 到 navigationController 。我不知道该怎么做请帮助我..提前感谢我使用此代码将数据从登录控制器传递到 tabbarcontroller
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
NSString * segueIdentifier = [segue identifier];
if([segueIdentifier isEqualToString:@"dashboard"]){
EventdashViewController *dc = [[EventdashViewController alloc] init];
FeedDashViewController *fc = [[FeedDashViewController alloc]init];
NewsDashViewController *nc = [[NewsDashViewController alloc]init];
UITabBarController* tbc = [segue destinationViewController];
dc = (EventdashViewController *)[[tbc customizableViewControllers] objectAtIndex:0];
dc.memberid = userid1;
NSLog(@"%d",dc.memberid);
fc = (FeedDashViewController *) [[tbc customizableViewControllers]objectAtIndex:1];
fc.memberid=userid1;
NSLog(@"%d",fc.memberid);
nc = (NewsDashViewController *)[[tbc customizableViewControllers]objectAtIndex:2];
nc.memberid = userid1;
NSLog(@"%d",nc.memberid);
}
}
如何将数据从视图控制器传递到标签栏控制器到导航控制器?