Version: 1.0

Posted: 2007-06-08

Build Requirements: Mac OS X v10.4, Xcode 2.4

Runtime Requirements: Mac OS X v10.4

View Source Code:

Download Sample (“BoundButton.zip”, 56.4K)
Download Sample (“BoundButton.dmg”, 108.5K)



Description

This is a simple example that illustrates how you can use Cocoa bindings to bind a button's target and action parameters.

In most situations, target/action is the appropriate pattern to use for buttons - you simply want a method to be invoked when the button is pressed. Sometimes, however, it may be convenient to use bindings to collect information from your application and pass it to the target using the method arguments, or the target itself might be selected dynamically. In these situations, using bindings may prove beneficial. This example illustrates the former case: the selections in two table views is collected from their corresponding array controllers using bindings.

Document Revision History

Date Notes
2007-06-08Illustrates using Cocoa bindings to bind a button's target and action parameters.

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.