O'Reilly logo

MacRuby in Action by Brendan G. Lim with Jerry Cheung and Jeremy McAnally

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 5. Notifications and implementing the observer pattern

 

This chapter covers
  • Notifying multiple objects
  • Posting and queuing notifications
  • Observing notifications
  • Building an iTunes-notification observer

 

In chapter 4, you learned a core fundamental of Cocoa development: delegation. But sometimes creating your own delegates won’t work. This is where notifications come in. Delegates are important and are used throughout Cocoa, but delegates assign one object as the delegate object—this single object is responsible for responding to an event. What if you need multiple objects to respond to the same event? That’s when you want to use notifications.

By the end of this chapter, you’ll be a notification ninja. We’ll explore what makes ...

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