Post

Replies

Boosts

Views

Activity

NSStatusIcon mysteriously vanishes from menu bar
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?
Topic: UI Frameworks SubTopic: AppKit
0
0
110
2w
Any way to use a SymbolEffect in an NSButton
Examples of using SymbolEffect in AppKit all seem to be in NSImageView, and look through APIs it seems that the only way to apply those effect animations outside of SwiftUI is indeed in an NSImageView. I have a NSStatusItem where I'm using an SF Symbol in the NSStatusBarButton title (subclass of NSButton) and was trying to figure out if there was a way to use a SymbolEffect there. If the image of an NSButton uses (used) an NSImageView under the hood, that used to hidden in the buttons cell. Seeing how cells seem to be inaccessible now, perhaps there isn't a NSImageView in there these days anyway. Can NSStatusBarButton titles be provided by a custom view, oh I'm guessing the deprecated view property is still operational, but if I'm trying to release to the Mac App Store, that as equally off-limits as an NSButtonCell would have been. Is there a non-deprecated way that will let me ship to the App Store?
1
3
1k
Feb ’24