Closed jeremybernstein closed 3 years ago
That's odd! I don't know why it would have changed in Big Sur, or the release I did for Big Sur support.
Do you know where exactly the \0
is in the interface name? And how do you know it's there, when it isn't generally visible?
If you check out my Audio-MIDI Setup config (attached), you can see the /0s registered by the device, but it's visible in the debugger, as well. It requires some extra love when performing NSString concatenation. This is a pretty old interface and I've never seen this problem with other devices, but it's a device.
I have some code lying around to do "safe" concatenation for cases like this, happy to pass it along, but I'm sure it's nothing surprising or novel to you.
Thank you! Will check that out when I can. I vaguely recall NS/CFString having issues with embedded \0
s, but I'm sure I can search for more details if needed.
Looks like Apple introduced a bug in NSPopUpButton. It worked correctly in 10.9 (Mavericks) and 10.11 (El Capitan), but is broken in 10.15.7 (Catalina) and apparently 11.0 (Big Sur) too. (Not sure exactly when it broke -- sometime in that span.)
Worked around it by stripping \0 characters from the item title.
Thanks!
I think this is a regression from pre-BigSur versions. My multiport MIDI interface is displayed properly in the menu when it's open, but only the interface name is displayed when the menu is closed. I've run into this issue before with other software -- the interface name contains a \0 character, which is legal in NSStrings, but causes trouble when names are concatenated. Not sure if that's what's happening here, but it's my suspicion.