NSTokenFieldCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.4 and later.
Companion guide
Declared in
NSTokenFieldCell.h

Overview

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.

Tasks

Managing the Token Style

Managing the Tokenizing Character Set

Configuring the Completion Delay

Managing the Delegate

Class Methods

defaultCompletionDelay

Returns the default completion delay.

+ (NSTimeInterval)defaultCompletionDelay
Return Value

The default completion delay.

Discussion

The default completion delay is 0.

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

defaultTokenizingCharacterSet

Returns the default tokenizing character set.

+ (NSCharacterSet *)defaultTokenizingCharacterSet
Return Value

The default tokenizing character set.

Discussion

The default tokenizing character set contains the single character “,”.

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

Instance Methods

completionDelay

Returns the receiver’s completion delay.

- (NSTimeInterval)completionDelay
Return Value

The receiver’s completion delay.

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

delegate

Returns the receiver’s delegate.

- (id < NSTokenFieldCellDelegate >)delegate
Return Value

The receiver’s delegate.

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

setCompletionDelay:

Sets the receiver’s completion delay to a given delay.

- (void)setCompletionDelay:(NSTimeInterval)delay
Parameters
delay

The delay for the receiver.

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

setDelegate:

Sets the receiver’s delegate.

- (void)setDelegate:(id < NSTokenFieldCellDelegate >)anObject
Parameters
anObject

The delegate for the receiver.

Availability
  • Available in OS X v10.4 and later.
See Also
Declared In
NSTokenFieldCell.h

setTokenizingCharacterSet:

Sets the receiver’s tokenizing character set to a given character set.

- (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet
Parameters
characterSet

The tokenizing character set for the receiver.

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

setTokenStyle:

Sets the token style of the receiver.

- (void)setTokenStyle:(NSTokenStyle)style
Parameters
style

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

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

tokenizingCharacterSet

Returns the receiver’s tokenizing character set.

- (NSCharacterSet *)tokenizingCharacterSet
Return Value

The receiver’s tokenizing character set.

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

tokenStyle

Returns the receiver’s token style.

- (NSTokenStyle)tokenStyle
Return Value

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

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

Constants

NSTokenStyle

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

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

Style best used for keyword type tokens.

Available in OS X v10.4 and later.

Declared in NSTokenFieldCell.h.

NSPlainTextTokenStyle

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

Available in OS X v10.4 and later.

Declared in NSTokenFieldCell.h.

NSRoundedTokenStyle

Style best used for address type tokens.

Available in OS X v10.4 and later.

Declared in NSTokenFieldCell.h.