如何隐藏我们自己的应用程序

use*_*951 2 cocoa

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    [[NSWorkspace sharedWorkspace] hideOtherApplications];// Insert code here to initialize your application

}
Run Code Online (Sandbox Code Playgroud)

这会隐藏其他应用程序.我们还应该怎样做才能隐藏自己的主窗口?

rob*_*off 6

在Mac OS X 10.6及更高版本中:

[[NSRunningApplication currentApplication] hide];
Run Code Online (Sandbox Code Playgroud)