If I understand your problem correctly, the following should work in the first
view controller CalViewController
:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"yourSegueToTabBarIdentifier"]) {
UITabBarController *tbc = [segue destinationViewController];
DrinksViewController *dvc = tbc.viewControllers[0];
dvc.caloriesImported = 456;
FoodViewController *fvc = tbc.viewControllers[1];
fvc.someProperty = someValue;
}
}
Note that
DrinksViewController *dvc = [[DrinksViewController alloc] init];
dvc.caloriesImported = 456;
cannot work because it allocates a new instance of DrinksViewController
that
is completely unrelated to the instance used by the tab bar controller.