开发者

How to show desktop by minimize all the windows with current application in mac

I want to show desktop on button click ,for that i have used [[NSWorkspace sharedWorkspace] hideOtherApplications]; this is working it is showing desktop also but it is not hiding the a开发者_开发百科pplication through which we are running the project.


Try this:

for (NSWindow *win in [NSApp windows]) {
        [NSApp hide:win];
    }

Edit

This code does not hide xcode properly but it works fine under Finder:

NSArray *apps = [NSArray arrayWithArray:[[NSWorkspace sharedWorkspace] runningApplications]];
    for (NSRunningApplication *app in apps ) {
        [app hide];
    }
for (NSWindow *win in [NSApp windows]) {
            [NSApp hide:win];
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜