Possible Duplicate:
How to create a Menubar application for Mac
I have implemented a feed with Cocoa, for Mac OS X.
It’s a status application, displaying only the menu.Now basically I got three questions:
- When I launch it I always see the application icon in the dock.But this is a menu status application, how do I remove the dock icon? It should be an application like Watts and Dropbox, a pure menu;
- How do I prevent the user from launching the application multiple times? If the user does so, I would like to not launch a second instance of the application.
That would commonly be done using a filesystem lock (
flock) on unix based systems.But then again, Cocoa has an even simpler solution for that; you may check if an application is active by supplying its bundle identifier to the system.
See the NSRunningApplication Reference for more.