I used the Cocoa "Status Bar" tutorial (http://cocoatutorial.grapewave.com/tag/status-bar/) as a starting point in an attempt to build myself an agent that only appears as a StatusItem.
This application has no main NSWindow object, and it has three NSPanels associated with it. One NSPanel functions as an Application Preferences window, and the other two simply prompt the user to enter a short bit of text with an OK button.
The preferences panel is launched through an NSMenuItem, like so:
NSMenuItem *showPrefsMI = [[NSMenuItem alloc] initWithTitle:@"Show Prefs" action:@selector(makeKeyAndOrderFront:) keyEquivalent:@""];
[showPrefsMI setTarget:prefsPanel];
[menu addItem:showPrefsMI];
When I build and run the application from inside XCode, everything seems to work just fine. However, when I run the application from outside of Xcode, like from the Finder, these windows simply do not appear at all.
In addition, I am able to duplicate the behavior from within XCode. If I display the preferences panel, and then click off it (say, for example, I click on this Safari window), the preferences panel simply disappears, never to be seen again. I have to physically stop the application from within XCode and then run it again in order to get the Preferences Panel to re-appear.
Thanks in advance for anyone's help!