I have an app who's entire UI is a menu attached to a NSStatusIcon and after doing things in my app that largely work well, sometimes the icon is mysteriously vanishing from menu bar, its menu inaccessible.
I've seen it happen when launching normally, freshly built debug builds or release build installed from TestFlight, also launched from Xcode attached to lldb. In the latter case I can poke around in the state of the app but haven't been able to find any answers yet.
Things of note:
-
The menu bar icon isn't being removed in any normal fashion, it leaves an unnatural gap in the menu bar when my icon should be.
-
My app isn't crashing, hanging, or getting terminated: as evidenced by seeing it still running within Xcode. A part of my app that runs off a recurring timer responds normally to breakpoints.
-
The NSStatusIcon isn't getting released, its isVisible flag remains true, its button isn't going anywhere and neither is its button image.
-
Nothing interesting is logged to the Xcode console, I haven't found anything interesting in Console.app.
Does anyone know the state an app could get into that has this effect on its NSStatusIcon?