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];
I recommend you this method to share the app delegate: https://coderwall.com/p/z4h4uw?i=2&p=1&q=&t%5B%5D=%21%21mine&t%5B%5D=%21%21bookmarks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With