开发者

NSTask with no dock icon for child processes

I am trying to create a simple launcher application on the Mac.

I am able to set LSUIElement = 1 on the parent application, but child processes launched from the application appear in the Dock when launched.

Is there a way that I can prevent an icon for the application from showing up in the dock? This is the co开发者_Python百科de I'm currently trying to use.

NSString *launchPath = [[NSBundle mainBundle] pathForResource:@"HelloWorld" ofType:@""];
NSLog(@"%@", launchPath);

NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:launchPath];
[task launch];

Thanks!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜