< Previous PageNext Page > Hide TOC

Cocoa Bindings Tips

If your application uses Cocoa bindings, you should be aware of the differences between different types of value bindings. If you are using bindings to load images or large amounts of text, using the data or value bindings can offer significant performance advantages over the valuePath or valueURL bindings.

When you use the data or value bindings to load data, the bindings system retrieves the needed data directly from the attached model object, which is usually in memory. Conversely, when you use the valuePath and valueURL bindings, the system may have to retrieve the data from a hard drive or other slow device where the information resides. Because the bindings system does not know anything about your data model, it cannot effectively cache your data internally; it must retrieve it each time.

During scrolling or window resizing, the system may need to load bound data many times to match the currently visible contents of the window. Retrieving data repeatedly from the hard drive during these operations can slow down your application considerably. Therefore, if your view may be bound to large amounts of data, such as large text blocks or many images, it is better to use the data or value bindings.



< Previous PageNext Page > Hide TOC


© 2004, 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-08-11)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.