NSMenuItem Not Showing Explicitly Set Image on macOS Golden Gate - Xcode 27.

I have a few NSMenuItem's the set the image property. I only did this for a few specific context menus and this was done before Tahoe wanted to use SF Symbols for every menu item.

Now when my app is built with Xcode 27, these context menus aren't showing their images at all. For example I have code like:

-(void)viewDidLoad
{
 [super viewDidLoad];
  NSImage *specialImage = [NSImage imageNamed:@"SpecialImage"];
self.specialMenuItem.image = specialImage;
}

I never got around to adding SF Symbols for every NSMenuItem and it looks like macOS Golden Gates reverted that behavior. Maybe something to do with reverting that...has something to do with this. But as I said previously these menu items aren't using SF Symbols as their images, they are not connected to standard actions in the menu bar like Edit -> Undo. These are my own context menu items.

If I run the version of this app built with Xcode 26 the images show up. But when building from Xcode 27 SDK setting the image property on NSMenuItem does not work.

--

Ah I see there is this in the header now:

/// Set an image that is displayed next to the menu item's title. // Note that in macOS 27 and later, AppKit determines the >visibility of menu item images, and will typically hide images. >Use the preferredImageVisibility property with the .visible constant to specify that an image should always be visible.

Seriously what on earth is this? I have an entire context menu where not displaying an image would be completely inappropriate. Imagine when you right click a file in Finder and go Open -> Open With... and all the menu items for applications didn't show the icons. I have to beg the system for permission to display an image in my app's context menu? Why involve yourself in that situation? Why not preferredTitleVisibility too so the system can reserve the right to not display NSMenuItem titles?

Furthermore, if I set the image property on an NSMenuItem is NSMenuItemImageVisibilityVisible (great name BTW!) not implied? Why would I set the property, if I didn't want it to be displayed?

Hi, Apple engineer here. I appreciate we've created an unfortunate API behavior here. The UI changes between Tahoe and Golden Gate required us to disable menu item image visibility by default so that images added in Tahoe wouldn't show up in Golden Gate. Once building against the macOS 27 SDK, please do use preferredImageVisibility to mark those images that are still appropriate to keep visible on Golden Gate.

NSMenuItem Not Showing Explicitly Set Image on macOS Golden Gate - Xcode 27.
 
 
Q