I'm a beginner at iOS programming, so I'm probably asking something obvious. Anyway, I have a UISwitch
in my storyboard correctly connected to a property called mySwitch
declared in my UIViewController
. I'd like to know how to access that property from inside my app delegate. For instance, from inside applicationWillResignActive:
- (void)applicationWillResignActive:(UIApplication *)application
{
??? // don't know how to access the mySwitch property
if ([mySwitch isOn]) {
// perform some task
}
}
The answer I'm looking for will probably satisfy the more general question "What's the correct way to access a view object from my app delegate?" to which I haven't found an answer. Any help is really appreciated.