NSActionCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.0 and later.
Companion guide
Declared in
NSActionCell.h
Related sample code

Overview

An NSActionCell defines an active area inside a control (an instance of NSControl or one of its subclasses).

As an NSControl’s active area, an NSActionCell does three things: it usually performs display of text or an icon; it provides the NSControl with a target and an action; and it handles mouse (cursor) tracking by properly highlighting its area and sending action messages to its target based on cursor movement.

Tasks

Configuring an NSActionCell Object

Obtaining and Setting Cell Values

Managing the Cell’s View

Assigning the Target and Action

Assigning a Tag

Instance Methods

action

Returns the receiver’s action-message selector.

- (SEL)action
Availability
  • Available in OS X v10.0 and later.
Declared In
NSActionCell.h

integerValue

Returns the receiver’s value as a 64-bit compatible integer after validating any editing of cell content.

- (NSInteger)integerValue
Return Value

A 64-bit compatible integer value, as defined by the NSInteger type.

Discussion

If the receiver is not a text-type cell or the cell value is not scannable, the method returns 0.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSActionCell.h

setAction:

Sets the selector used for action messages sent by the receiver's control.

- (void)setAction:(SEL)aSelector
Parameters
aSelector

The selector that identifies the action method to invoke.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSActionCell.h

setControlView:

Sets the receiver's control view, the view in which it is drawn.

- (void)setControlView:(NSView *)view
Parameters
view

The view object, which is normally an NSControl view. Pass in nil if the receiver has no control view (usually because it hasn’t yet been placed in the view hierarchy).

Discussion

The control view is typically set in the receiver’s implementation of drawWithFrame:inView: (NSCell).

Availability
  • Available in OS X v10.4 and later.
Declared In
NSActionCell.h

setTag:

Sets the receiver’s tag.

- (void)setTag:(NSInteger)anInt
Parameters
anInt

An integer tag to be associated with the receiver.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.h

setTarget:

Sets the receiver’s target object.

- (void)setTarget:(id)anObject
Parameters
anObject

The object that is the target of action messages sent by the receiver's control.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSActionCell.h

tag

Returns the receiver’s tag.

- (NSInteger)tag
Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.h

target

Returns the receiver’s target object.

- (id)target
Availability
  • Available in OS X v10.0 and later.
Declared In
NSActionCell.h