Hello,
What is the best way to pass a variable from a UIViewController to a viewController in the UITabBarController before making it visible. The following code is throwing an error:
2010-09-13 11:51:40.752 iFlyGuide[948:207] *** -[UINavigationController setImageObj:]: unrecognized selector sent to instance 0x12a280
2010-09-13 11:51:40.758 iFlyGuide[948:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UINavigationController setImageObj:]: unrecognized selector sent to instance 0x12a280'
Code:
- (void)mapButtonPressed:(id)sender {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
MapViewController *mvc = [appDelegate.tabBarController.viewControllers objectAtIndex:2];
mvc.imageObj = self.imageObj;
appDelegate.tabBarController.selectedViewController = mvc;
}
From the current UIViewController, there is an object 'imageObj' I would like to pass that value to the MapViewController (which is part of the UITabBarController.viewControllers) before making it visible. Is this possible? I have declared and synthesized an 'imageObj' variable in MapViewController.
Thank you.