MyAppDelegate *appD;
appD = [UIApplication sharedApplication];
if(appD.sw1.on)
NSLog(@"It is ON");
else
NSLog(@"It is OFF");
Gives no error while compiling. Runs without any warning, but it doesn't work.
I dont see what the problem is.
...
EDIT: OMG, should have called delegate method too:
appD = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];