View Full Version : How to make a background applications?
davbeck
May 19, 2009, 10:14 AM
How do you make an application in cocoa that does not have a dock item or a menu? I was wanting to make a utility for the NSStatusBar but could not figure out how to remove everything else from the application.
kainjow
May 19, 2009, 11:13 AM
In the Info.plist file in your project, add an LSUIElement (http://www.cocoadev.com/index.pl?LSUIElement) item and set it to "1" (as a string).
davbeck
May 19, 2009, 11:15 AM
Thanks thats exactly what I was looking for.
larkost
May 19, 2009, 08:25 PM
In the Info.plist file in your project, add an LSUIElement (http://www.cocoadev.com/index.pl?LSUIElement) item and set it to "1" (as a string).
I think that you don't want this as a string, but as either a BOOL, or a number. There is now a mode "2", so the number is probably the most future proof, but there are manifests that make this a bool.
kainjow
May 19, 2009, 08:30 PM
I think that you don't want this as a string, but as either a BOOL, or a number. There is now a mode "2", so the number is probably the most future proof, but there are manifests that make this a bool.
Where do you see documentation for this? Everywhere I've looked Apple says to use a string (and to set it to "1"), and that's what I've always used. However recently I did use the following which also worked (on Leopard): <key>LSUIElement</key>
<true/>
So they must be checking for strings and numbers.
davbeck
May 20, 2009, 10:16 AM
In Xcode if you type in LSUIElement, it is replaced with "Application is agent (UIElement)" and changes the type to BOOL. such settings works perfectly on Leopard.
The documentation does say string with "1" though.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.