Using Object Controller for Binding

Discussion in 'Mac Programming' started by Sergio10, Mar 29, 2009.

  1. macrumors regular

    Joined:
    Oct 3, 2007
    #1
    Hi,
    I use Object Controller in xcode 3.1 for the control bindings.

    I want that edit field control shows my slider position when drag it.

    How do I know what exactly value I need to bind in Binding Inspector of the Interface Builder("stringValue", "value" or "floatValue") ?
    [​IMG]

    Thanks,
    Sergio
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    I'd bind both your text field and slider to either file's owner or an object controller to the same value. Bindings don't work from a UI object to another, they work from a UI object to a controller.
     
  3. thread starter macrumors regular

    Joined:
    Oct 3, 2007
    #3
    I mean how to know that max slider position parameter is "maxValue" not "MAX_VALUE" or something else? Where can I see controls name convention parameter when I bind it via Interface Builder?
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    While bindings can do this, you can't bind a control directly to another with this approach. I would suggest reading through the intro to bindings.

    What you can do is control-click your slider and drag to the text field, and then select "takeIntegerValueFrom:" (or one of the other similar methods). You can then select on the slider attributes inspector "Continuous" for it to update instantly.
     

Share This Page