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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.