I’ve written a little application with different UIViewControllers. In my AppDelegate I’ve this:
self.window.rootViewController = [[UINavigationController alloc]
initWithRootViewController:
[[MainViewController alloc] init]];
MainViewController, contains a method:
- (void)aMethod
{
[self.navigationController pushViewController:[[CellViewController alloc] init]
animated:TRUE];
}
CellViewController, contains a method:
- (void)aMethod
{
StartToBuildViewController * controller = [[StartToBuildViewController alloc] init];
[self.navigationController pushViewController:controller animated:true];
}
And so on. My question is: What’s the best way to share informations from a UIViewController to others? I just need to store flag status and/or datetime value. Can I use global variables? Database? What else?
I came from php, and in php I would use database or session variables.
In IOS SDK, its depend on user requirement and understanding.
While you can store flags in NSUserDefault or Create Global variable using extern or create AppDelegate variable with define property.
thanks