PDA

View Full Version : How to identify app is running in hidden mode?




newformac
Jun 8, 2011, 12:45 AM
Hi all,

i m hiding my app using "orderOut" from main window class where i m using "awakeFromNib",

and using other NSObject derived class to to some function here in NSObject derived class how can i identify the app is running in hidden mode.

please help me for this.

thanks in advance.



Blakeasd
Jun 8, 2011, 10:05 AM
BOOL appHidden = [NSApp isHidden];
if (appHidden == TRUE) {
NSLog(@"The app is hidden");
} else {
NSLog(@"The app is not hidden");
}



1.Create a BOOL (value is true or false) and set it equal to the value of [NSApp isHidden]
2.Create an if statement and simply test the value

newformac
Jun 9, 2011, 12:01 AM
BOOL appHidden = [NSApp isHidden];
if (appHidden == TRUE) {
NSLog(@"The app is hidden");
} else {
NSLog(@"The app is not hidden");
}



1.Create a BOOL (value is true or false) and set it equal to the value of [NSApp isHidden]
2.Create an if statement and simply test the value

this BOOL appHidden = [NSApp isHidden]; alwaz return NO whether the application is visible of hidden.