How to identify app is running in hidden mode?

Discussion in 'Mac Programming' started by newformac, Jun 7, 2011.

  1. newformac macrumors regular

    May 24, 2011
    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.
  2. Blakeasd macrumors 6502a

    Dec 29, 2009
        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
  3. newformac thread starter macrumors regular

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

Share This Page