O'Reilly logo

Cocoa® Programming for Mac® OS X, Fourth Edition by Aaron Hillegass, Adam Preble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 26. Creating NSFormatters

A formatter takes a string and makes another object, typically so that the user can type something that is more than just a string. For example, the NSDateFormatter, when passed the string August 17, 1967, converts it into an NSDate object that represents the seventeenth day of August in the year 1967 (Figure 26.1).

Figure 26.1. NSDateFormatter

Image

Also, a formatter can take an object and create a string for the user to see. For example, imagine a text field that has an NSDateFormatter. When the text field is sent setObjectValue: with an NSDate object, the date formatter will create a string that represents that date. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required