NSStatusItem disappears

I’m using MacOSLib to create a StatusItem for my app. Some users are reporting that the StatusItem disappears randomly. The app itself is still open. I haven’t experienced this myself. How do I make sure that the StatusItem stays in the menubar?

This might be what the users are experiencing: http://stackoverflow.com/questions/8873418/nsstatusitem-appears-briefly-on-launch-but-promptly-disappears

How to retain NSStatusItem it using MacOSLib?

Here is my way to do NSStatusItem.
It is without MacOSLib, but similar

myStatusItem.Retain    //?

This sometimes happens, especially on a smaller screen. If a user has an app with a lot of menus and/or a lot of other NSStatusItems, OS X will start quietly hiding StatusItems to fit. They return whenever there is enough room. I’ve never found a way to detect this behavior in code, much to my frustration. But maybe this is what your users are seeing.

I actually have a feature request for an AppleEvent notification to notify an application when it’s statusitem has been hidden. I know you can’t see them, but if you’re an active Apple Developer, you could create another RADAR report and reference radr://9885228.

BTW - I requested this in Aug of 2011 and it isn’t even marked in Apple’s system as reviewed.

“You must use the value returned by this function”

I’ll try

Call StatusItem.Retain

and see what happens.