macOS 26 adds image to NSMenuItem on its own

In my Mac app, there is a menu item whose title is "Copy", and another called "Zoom to Marker".

Apparently appkit sees fit to inject its own images into these items (off-state images I suppose). Why it was consider a good idea to begin with is unclear, because how can you be sure these images are appropriate?

If that wasn't bad enough, the framework does not even check that these menu items already have off state images. So now the menu items get two images! How do I prevent this?

Note: I use Xcode 16.

Answered by jeanlain in 860276022

Nevermind, I just realized I used the offStateImage rather than the image property for these menu items. The custom images indeed replace the default images, as expected.

Accepted Answer

Nevermind, I just realized I used the offStateImage rather than the image property for these menu items. The custom images indeed replace the default images, as expected.

macOS 26 adds image to NSMenuItem on its own
 
 
Q