Data Formatting Guide

Introduction to Data Formatting Programming Guide For Cocoa

You use formatters to interpret and create strings that represent other data types, and to validate the text in text fields and other cells. Formatters are instances of subclasses of the abstract class, NSFormatter. The Foundation framework provides two concrete subclasses of NSFormatter: NSNumberFormatter and NSDateFormatter. (Core Foundation provides two equivalent opaque types: CFNumberFormatter and CFDateFormatter. These are similar but are not toll-free bridged.) You can create a subclass of NSFormatter for custom formatting.

You should read this document to gain a basic understanding of how to create and use date and number formatters, and how you can create a custom formatter object.