O'Reilly logo

Objective-C Programming: The Big Nerd Ranch Guide by Mikey Ward, Aaron Hillegass

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

36 Key-Value Observing

Key-value observing is a technique that lets you get a notification when a particular property of an object changes. Although you will not use it everyday, key-value observing (or KVO) is a crucial part of what makes Cocoa bindings and Core Data possible.

Essentially, you tell an object, I want to watch your fido property. If it changes, let me know. When the setFido: method gets called, you will get sent a message from the object you are observing: Hey, my fido property has a new value.

When you add yourself as an object’s observer, you specify the name of the property you are observing. You can also specify some options. In particular, you can tell the object to send you the old and/or new value of ...

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