Skip to Main Content
Cocoa Programming for Mac OS X, Third Edition
book

Cocoa Programming for Mac OS X, Third Edition

by Aaron Hillegass
May 2008
Intermediate to advanced content levelIntermediate to advanced
464 pages
8h 13m
English
Addison-Wesley Professional
Content preview from Cocoa Programming for Mac OS X, Third Edition

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 simply a string. For example, when passed the string “3/17/1975”, the NSDateFormatter converts it into an NSDate object that represents the seventeenth day of March in the year 1975 (Figure 26.1).

NSDateFormatter

Figure 26.1. NSDateFormatter

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 NSCalendarDate object, the date formatter will create a string that represents that date. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

Aaron Hillegass

Publisher Resources

ISBN: 9780321562739Purchase book