---
title: Introduction to Control and Cell Programming Topics for Cocoa
framework: cocoa
role: article
path: apple-archive/documentation/Cocoa/Conceptual/ControlCell
---

# Introduction to Control and Cell Programming Topics for Cocoa

Explains the relationship between Cocoa control and cell objects.

## Organization of This Document

Controls and cells implement user-interface objects, like buttons, text fields, and sliders. The control is responsible for

- Displaying itself - Intercepting user events (such as a clicking a button or moving a slider) - Sending actions to other objects, usually in response to a user event (such as changing a variable’s value as a slider moves or performing a command when a button is pressed.)

A control usually delegates the first two responsibilities to cells. Splitting these responsibilities off makes it easier to create a control with many identical elements (like a spreadsheet table) or with a few different elements (like a pull-down list that lets you enter a string either in a text field or from a menu of pre-elected strings).

Here are the concepts:

- [About Cells and Controls](Concepts/AboutControlsCells.html#//apple_ref/doc/uid/20000731-BBCEACEA) gives basic information on what the NSCell and NSControl classes do. - [How Controls and Cells Interact](Concepts/ControlsAndCells.html#//apple_ref/doc/uid/20000068-BBCBGEFB) gives more information on how controls and cells interact and how they operate. - [Cell States](Concepts/CellStates.html#//apple_ref/doc/uid/20000069-BBCEACEA) describes the three states a control can have: on, off, or mixed. Although used primarily by NSButton, states are defined in NSCell so future subclasses can use them. - [Represented Objects](Concepts/RepresentedObjects.html#//apple_ref/doc/uid/20000067-BCIBDCII) explains how to associate a cell with the object it represents.

Here are the tasks:

- "[Manipulating Cells and Controls](Articles/ManipulateCellControl.html#//apple_ref/doc/uid/TP40002338-SW2)" discusses various tips and techniques for dealing with cells and controls. - [Changing the Cell for a Control](Tasks/ChangingCellClass.html#//apple_ref/doc/uid/20000072-BCIBFAHH) describes how to change the NSCell subclass that a control uses. - [Displaying Cell Values](Tasks/DisplayingCellValues.html#//apple_ref/doc/uid/20000071-BBCEAFCE) describes how some cells format and display their values as strings. - [Validating Control Entries](Tasks/ValidatingControlEntries.html#//apple_ref/doc/uid/20000070-BCIBIJEJ) describes how to validate the contents of some cells, especially cells in a matrix or text field. - [Using a Continuous Control](Tasks/UsingContControl.html#//apple_ref/doc/uid/20000250-BCIDJCGE) describes how to set up a control so it sends its action message repeatedly while being pressed. - [Subclassing NSCell](Tasks/SubclassingNSCell.html#//apple_ref/doc/uid/20000728-BCIBFAHH) and [Subclassing NSControl](Tasks/SubclassingNSControl.html#//apple_ref/doc/uid/20000730-BCIDJCGE) describe how to create custom subclasses of NSCell and NSControl. - [Using the System Control Tint](SystemTintAware.html#//apple_ref/doc/uid/20002180-BCIBFAHH) describes how to use the system-wide control tint in your custom views and control cells.

[Next](Concepts/AboutControlsCells.html)

Copyright © 2008 Apple Inc. All Rights Reserved. [Terms of Use](http://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](http://www.apple.com/privacy/) | Updated: 2008-10-15
