NSTokenField 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
NSTokenField.h
Related sample code

Overview

NSTokenField is a subclass of NSTextField that provides tokenized editing similar to the address field in the Mail application.

NSTokenField uses an NSTokenFieldCell to implement much of the control’s functionality. NSTokenField provides cover methods for most methods of NSTokenFieldCell, which invoke the corresponding cell method.

Tasks

Configuring the Token Style

Configuring the Tokenizing Character Set

Configuring the Completion Delay

Getting and Setting the Delegate

Class Methods

defaultCompletionDelay

Returns the default completion delay.

+ (NSTimeInterval)defaultCompletionDelay
Discussion

The default completion delay is 0.

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

defaultTokenizingCharacterSet

Returns the default tokenizing character set.

+ (NSCharacterSet *)defaultTokenizingCharacterSet
Discussion

The default tokenizing character set is “,”.

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

Instance Methods

completionDelay

Returns the receiver’s completion delay.

- (NSTimeInterval)completionDelay
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h

delegate

Returns the token field’s delegate.

- (id < NSTokenFieldDelegate >)delegate
Return Value

The token field’s delegate

Availability
  • Available in OS X v10.6 and later.
Declared In
NSTokenField.h

setCompletionDelay:

Sets the receiver’s completion delay.

- (void)setCompletionDelay:(NSTimeInterval)delay
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h

setDelegate:

Sets the token field’s delegate

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

The delegate for the receiver. The delegate must conform to the NSTokenFieldDelegate Protocol protocol.

Availability
  • Available in OS X v10.6 and later.
See Also
Declared In
NSTokenField.h

setTokenizingCharacterSet:

Sets the recevier’s tokenizing character set to characterSet.

- (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h

setTokenStyle:

Returns the token style of the receiver.

- (void)setTokenStyle:(NSTokenStyle)style
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h

tokenizingCharacterSet

Returns the receiver’s tokenizing character set.

- (NSCharacterSet *)tokenizingCharacterSet
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h

tokenStyle

Returns the receiver’s token style.

- (NSTokenStyle)tokenStyle
Availability
  • Available in OS X v10.4 and later.
Declared In
NSTokenField.h