Search code examples
objective-cmacoscocoashow-hide

How to unhide the hidden application in mac os programmatically?


I want to unhide the hidden applications in mac os . For hiding I am using this [ [ NSWorkspace sharedWorkspace ] hideOtherApplications ];

Something like this


Solution

  • There's several ways to unhide all hidden apps — here are a couple of them:

    NSWorkspace:

    NSMutableArray *arr = [[NSMutableArray alloc] init];
    
    for (NSRunningApplication *app in [[NSWorkspace sharedWorkspace] runningApplications]) {
        [app unhide];
    }
    

    ...or...

    NSApplication:

    - (void) unhideAllApplications:(id)sender{
        [NSApp unhideAllApplications:sender];
    }
    

    and call with something like:

    [self unhideAllApplications:nil];