Instance Method

initTextCell:pullsDown:

Returns an NSPopUpButtonCell object initialized with the specified title.

Declaration

- (instancetype)initTextCell:(NSString *)stringValue pullsDown:(BOOL)pullDown;

Parameters

stringValue

The title of the first menu. You may specify an empty string if you do not want to add an initial menu item.

pullDown

YES if you want the receiver to display a pull-down menu; otherwise, NO if you want it to display a pop-up menu.

Return Value

An initialized NSPopUpButtonCell object, or nil if the object could not be initialized.

Discussion

This menu item is assigned the default pop-up button action that displays the menu. To set the action and target, use the setAction: and setTarget: methods of the item’s corresponding NSMenuItem object.

This method is the designated initializer of the class.