Contents

Introduction to Token Field Programming Guide for Cocoa

Describes how to set up and programatically manage a token field.

Token Fields at a Glance

A token field is a text field with tokens as content. A token represents a string or other object.

  • Construction: Single-cell control
  • Classes and inheritance: Control: NSTokenField : NSTextField : NSControl : NSView : NSResponder : NSObject
  • Cell: NSTokenFieldCell : NSTextFieldCell : NSActionCell : NSCell : NSObject

Design patterns: Target-action, delegation, key-value observing

Object attributes: Tokenizing character set, completion delay, token style

Important methods: objectValue (NSControl), tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem: (delegate), tokenField:representedObjectForEditingString: (delegate), tokenField:displayStringForRepresentedObject:d (delegate), tokenField:menuForRepresentedObject: (delegate)

Important bindings: value

Usage guidelines: Under “Text Controls” in “ <!--a target="_self" -->UI Element Guidelines: Controls<!--/a--> " (Apple Human Interface Guidelines)

Organization of This Document

This document consists of the following chapters:

Next

Copyright © 2007 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2007-12-11