Mac Developer Library

Developer

AppKit Framework Reference NSTokenFieldCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSTokenFieldCell

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.

NSTokenFieldCell is a subclass of NSTextFieldCell that provides tokenized editing of an array of objects similar to the address field in the Mail application. The objects may be strings or objects that can be represented as strings. A single token field cell can be presented in an NSTokenField control.

  • Sets the token style of the receiver.

    Declaration

    Swift

    var tokenStyle: NSTokenStyle

    Objective-C

    @property NSTokenStyle tokenStyle

    Parameters

    style

    The token style for the receiver. The valid values are described in NSTokenStyle.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – tokenStyle

  • Returns the receiver’s token style.

    Declaration

    Swift

    var tokenStyle: NSTokenStyle

    Objective-C

    @property NSTokenStyle tokenStyle

    Return Value

    The receiver’s token style. The valid values are described in NSTokenStyle.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the receiver’s delegate.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSTokenFieldCellDelegate?

    Objective-C

    @property(assign) id<NSTokenFieldCellDelegate> delegate

    Return Value

    The receiver’s delegate.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s delegate.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSTokenFieldCellDelegate?

    Objective-C

    @property(assign) id<NSTokenFieldCellDelegate> delegate

    Parameters

    anObject

    The delegate for the receiver.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – delegate

  • The NSTokenStyle constants define how tokens are displayed and editable in the NSTokenFieldCell. These values are used by tokenStyle, setTokenStyle: and the delegate method tokenFieldCell:styleForRepresentedObject:.

    Declaration

    Swift

    enum NSTokenStyle : UInt { case Default case None case Rounded case Squared case PlainSquared }

    Objective-C

    enum { NSDefaultTokenStyle, NSPlainTextTokenStyle, NSRoundedTokenStyle }; typedef NSUInteger NSTokenStyle;

    Constants

    • NSDefaultTokenStyle

      NSDefaultTokenStyle

      Style best used for keyword type tokens.

      Available in OS X v10.4 through OS X v10.9.

    • NSPlainTextTokenStyle

      NSPlainTextTokenStyle

      Style to use for data you want represented as plain-text and without any token background.

      Available in OS X v10.4 through OS X v10.9.

    • NSRoundedTokenStyle

      NSRoundedTokenStyle

      Style best used for address type tokens.

      Available in OS X v10.4 through OS X v10.9.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.