How can I call the same ViewController from two TabBar items?
I used:
MyViewController *vc1 = [[MyViewController alloc] initWithNib:@"MyViewController" bundle:nil]; MyViewController *vc2 = [[MyViewController alloc] initWithNib:@"MyViewController" bundle:nil];
UITabBarController *tabs = [[UITabBarController alloc] init]; [tabs setViewControllers:[NSArray arrayWithObjects:vc1, vc2, nil] animated:NO];
But variables will be reset, I want to keep the variables.
My view controller contains TableView with listdata, I just want to show first three of them when I click one 2nd TabBar, but listdata variable is reset and become nil.
Any fix? Thanks