Using control:textView:doCommandBySelector

  • I must confess, I don't get Cocoa bindings. I've used them for user
    defaults, and that's it.

    My app has a number of NSTextField/slider pairs for inputting numeric
    values. I'd like to support having the up and down arrow keys increase/
    decrease my values by a set amount, and having shift up/down arrow
    increase/decrease by 10x that amount. (much like PhotoShop does.)

    I could do this by subclassing NSTextField and adding a new -keyDown
    method that handled the up and down arrow keys.The
    control:textView:doCommandBySelector method seems like a more elegant
    way to make this work.  However, I have no clue how to set up key
    bindings for my control fields in IB, and can't find any documentation
    to explain what I need to do.

    In addition to needing some specific guidance on this particular
    issue, I'd also like to know a good reference (online or print) that
    explains using Cocoa bindings clearly, including working code
    examples? Most of the print manuals I use don't cover this subject.

    Thanks in advance for any help you can offer.

    Regards,

    Duncan Champney