Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

davbeck

macrumors regular
Original poster
May 16, 2008
104
0
Reno, NV
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.
 
In the Info.plist file in your project, add an 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.
 
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):
Code:
<key>LSUIElement</key>
<true/>
So they must be checking for strings and numbers.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.