I try to hide a NSMenuItem but the method doesn’t work. My NSMenuItem is not nil (-setTitle, -setEnabled work as expected). Outlet is connected correctly in the IB and -setAutoEnableItem is set to NO.
But [item setHidden:YES]; doesn’t change anything. Do you have an idea how to hide a NSMenuItem?
To remove and add the item again is no option for me.
NSMenuItemhide problems are due to alternate items. If item have alternate item or items it can’t be hidden. But You can solve it like this:For example You want to hide item2 with alternate items itemAlt2 and itemCtrl2. So make itemAlt2 and itemCtrl2 not alternates and hidden like this:
And when You need visible item2 just make them alternate and visible like this: