Returning to a Mac Catalyst app that I put to the side for awhile..when running it on Xcode 26.1 it crashes at launch with:
Assertion failure in -[NSToolbarItemGroupView _layoutWrapperViewsWithAttributes:], NSToolbarItemGroupView.m:599
No attributes were found for item
Call stack has a bunch of Autolayout code in AppKit like:
[NSWindow(NSConstraintBasedLayoutInternal) _layoutViewTree] + 120 50 AppKit 0x00000001911e8a10 -[NSWindow(NSConstraintBasedLayoutInternal) layoutIfNeeded] + 240 51 UIKitMacHelper 0x00000001a98f293c -[UINSWindow layoutIfNeeded] + 56
A few unnamed symbols mixed in maybe that's that Swiftness beneath the surface. App is just murdered on launch. I assume this is related to using NSToolbarItemGroup when building an NSToolbar...
I do see this log out:
NSToolbarItemGroup does not support selectionMode. Create the group with one of the class constructors to support selection.
Which is an interesting log so I commented out all calls to setSelectionMode: but still the same crash.
I do set the groups subitems property directly (I do not use the class constructors as the logging statement above indicates). I have no idea if using the class constructors will workaround this issue or not but I'm not particularly excited about that idea because I have items in the same toolbar group with different actions.
So using the class constructor is pretty much the only reasonable way around this. I'm marking this reply as the correct answer. You can also avoid the crash by setting UIDesignRequiresCompatibility to YES in your Info.plist and use the pre Liquid Glass UI.
maybe I'd file a bug but I don't think Apple responded to like 95% of my Catalyst bugs I reported in the past. I must have reported more than a dozen so I'm not going to be filing this one.
FYI if you migrate to the group class constructor... if you have to do any per item tweaks you can apparently just dig in the subitems array right after you create the GroupItem (to set different actions on particular subitems etc.) HOPEFULLY they don't release an update that breaks that.