Icon for some menu items cannot be removed on macOS 26

  1. create a sample XCode project using Objective-C and stroybook (xib) using latest XCode beta
  2. open MainMenu.xib, and select Main Menu → File → Print...
  3. remove the image like below

4. build it 5. run it on macOS 26 beta 7 6. The menu item "print.." still have "Image"

Is there any way to remove image for one menu item.

I have also tried NSMenuItem.image = nil, but still not work.


The issue I met on my own app is that I cannot remove icons for "Zoom In", "Zoom Out" and many other menu items, which makes the menu items not aligned properly.

What's happening here is that you have a menu item with a default image for its action, and you're assigning nil to the image property of the item before the menu is ever displayed.

Normally, when an app assigns a value to a menu item's image property, AppKit will remove the "has a default image" state from the menu item. However, AppKit has a special case for this particular path, where nil is assigned prior to the menu being displayed. In this case, the "has a default image" state is not removed, and the menu item retains its default image. This is meant to improve compatibility with some apps that create a new item and immediately set the image to nil unconditionally. Without this special-case behavior, these apps would not get the default image at all. The special-case behavior allows these apps to still get the default image for their item actions.

In your case, the recommended solution would be to set the menu item's image to a non-nil image object first, and then immediately set to nil. That will remove the default menu item image.

Icon for some menu items cannot be removed on macOS 26
 
 
Q