Mac Developer Library

Developer

AppKit Framework Reference NSActionCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSActionCell

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

Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.0 and later.
  • setFloatingPointFormat:left:right: setFloatingPointFormat:left:right: Available in OS X v10.0 through OS X v10.5

    Sets the receiver’s floating-point format.

    Deprecation Statement

    Deprecated; use NSFormatter objects instead.

    Declaration

    Objective-C

    - (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits

    Parameters

    autoRange

    NOfalse if you want the receiver to places digits to the right and left of the decimal point as specified (in leftDigits and rightDigits; YEStrue if you want it to place the digits flexibly.

    leftDigits

    The maximum number of digits to the left of the decimal point. The receiver might interpret this value flexibly if autoRange is YEStrue.

    rightDigits

    The maximum number of digits to the right of the decimal point. The receiver might interpret this value flexibly if autoRange is YEStrue.

    Discussion

    The implementation of this method is based on the NSCell method setFloatingPointFormat:left:right:. See the description of that method for details.

    The NSActionCell implementation of the method supplements the NSCell implementation by marking the receiver as needing redisplay after discarding any editing changes that were being made to cell text.

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

  • floatValue floatValue Available in OS X v10.0 through OS X v10.5

    Returns the receiver’s value as a float after validating any editing of cell content.

    Declaration

    Objective-C

    - (float)floatValue

    Discussion

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

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

    See Also

    validateEditing (NSControl)

  • intValue intValue Available in OS X v10.0 through OS X v10.5

    Returns the receiver’s value as an int after validating any editing of cell content.

    Declaration

    Objective-C

    - (int)intValue

    Discussion

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

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

    See Also

    validateEditing (NSControl)

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

    Declaration

    Objective-C

    - (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.

    Import Statement

    Availability

    Available in OS X v10.5 and later.

  • stringValue stringValue Available in OS X v10.0 through OS X v10.5

    Returns the receiver’s value as a string object as converted by the cell’s formatter, if one exists.

    Declaration

    Objective-C

    - (NSString *)stringValue

    Discussion

    If no formatter exists and the value is an NSString, returns the value as a plain, attributed, or localized formatted string. If the value is not an NSString or cannot be converted to one, returns an empty string. The method supplements the NSCell implementation by validating and retaining any editing changes being made to cell text.

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

    See Also

    validateEditing (NSControl)

  • setObjectValue: setObjectValue: Available in OS X v10.0 through OS X v10.5

    Discards any editing of the receiver’s text and sets its object value to object.

    Declaration

    Objective-C

    - (void)setObjectValue:(id < NSCopying >)object

    Parameters

    object

    The object value to assign to the receiver.

    Discussion

    If the object value is afterward different from what it was before the method was invoked, the method marks the receiver as needing redisplay.

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

  • controlView controlView Available in OS X v10.0 through OS X v10.5

    Returns the view in which the receiver was last drawn.

    Declaration

    Objective-C

    - (NSView *)controlView

    Return Value

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

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

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

    Declaration

    Objective-C

    - (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).

    Import Statement

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var action: Selector

    Objective-C

    @property SEL action

    Parameters

    aSelector

    The selector that identifies the action method to invoke.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the receiver’s action-message selector.

    Declaration

    Swift

    var action: Selector

    Objective-C

    @property SEL action

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the receiver’s target object.

    Declaration

    Swift

    weak var target: AnyObject?

    Objective-C

    @property(weak) id target

    Parameters

    anObject

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the receiver’s target object.

    Declaration

    Swift

    weak var target: AnyObject?

    Objective-C

    @property(weak) id target

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the receiver’s tag.

    Declaration

    Swift

    var tag: Int

    Objective-C

    @property NSInteger tag

    Parameters

    anInt

    An integer tag to be associated with the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – tag

  • Returns the receiver’s tag.

    Declaration

    Swift

    var tag: Int

    Objective-C

    @property NSInteger tag

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – setTag: