Re-programming the examples on Cocoa Programming for Mac OS X