An App without dock icon and menu bar

You might want to create an application that doesn’t appear in the dock or in the selector (Cmd-Tab), may it be because it’s a background application or a kind of widget you only want to show through a window for instance.

This is pretty simple: the only step is to add this key in the Info.plist file in your Cocoa Xcode project :

<key>LSUIElement</key>
<string>1</string>

An UIELement is an application that is background only but still has a UI (eg a floating utility window).

In the case of a ‘real’ background application, you might want to add this bit instead :

<key>LSBackgroundOnly</key>
<string>1</string>

As a matter of fact, the value set for LSBackgroundOnly overrides the value set for LSUIElement, thus setting both to 1 has the same effect than setting LSBackgroundOnly to 1…

Result : when running your application, no dock icon will show up. You won’t get a menu bar either (but you will get a window if you didn’t touch the nib file).

Advertisement

1 Response to “An App without dock icon and menu bar”


  1. 1 makojad July 28, 2009 at 6:02 am

    Many thanx for this trick.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Talking about Cocoa

Here is a little blog dealing with Mac programming : snippets, technology, ...

Categories


Follow

Get every new post delivered to your Inbox.