Monthly Archives: May 2010

Chapter 14: Notifications

The Notification pattern is called the Observer pattern outside of the Cocoa community. Head First Design Patterns covers the Observer pattern, and I did its example in C++. You’ve probably used yourself, since it’s covered in Hillegass’s Cocoa Programming for … Continue reading

Posted in Debugging hints | Tagged | Leave a comment

Chapter 13: Singleton

The Singleton Pattern seeks to control access to a unique resource by leaving it under the control of a class that by design can have only one instance. Typically, the class stores a pointer to the unique instance as a … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Chapter 12: Copying

Properly copying an object poses some questions, the most important of which is whether to make a shallow or deep copy. If an object has pointers to other objects, a shallow copy of the object contains pointers to the same … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Chapter 11: Archiving and Unarchiving

Storing data on disk and getting it back into memory is one of the basics tasks of almost all applications. Cocoa provides developers some simple and powerful ways of accomplishing these tasks, through the NSArchiver and NSUnarchiver classes. They will … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment