NSMenu Class

The NSMenu Class is the basis for all Cocoa menus. It manages a collection of NSMenuItem instances. It also handles the management of a borderless window used to display the menu. Because the NSMenu object acts as a collection containing several menu items, most of its methods are for manipulating a list of menu items. Aside from variations in the names, these methods are very similar to the methods defined by NSMutableArray.

NOTE

Because both the NSMenu and the NSMenuItem classes are nearly always used together, this section explains the NSMenu methods but does not provide specific code examples. Instead, the “NSMenuItem Class” section later in this chapter provides example code showing how both classes are used. You need to first ...

Get Cocoa® Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.