How to identify app is running in hidden mode?

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

  1. macrumors regular

    Joined:
    May 24, 2011
    #1
    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. macrumors 6502a

    Joined:
    Dec 29, 2009
    #2
    Code:
    
        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. thread starter macrumors regular

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

Share This Page