Objective-C and the Cocoa frameworks tend to make most common tasks trivial. Finding the best and easiest way to accomplish a task in Objective-C is usually the hardest part. The documentation is plentiful, but it is rarely structured in a way that answers multistep questions such as the one presented in this article.
Whenever you feel like you are pushing a square peg into a round hole with Cocoa, take a step back, reread the examples, and (last but not least) ask the mailing lists provided by Apple. Most of the time there is a simple answer waiting in the shadows.