On May 28, 2013, at 13:16 , Paul Johnson <p...@askerko.net> wrote:

> I have a slider, a stepper, and a textField that are synchronized using
> bindings. I didn't write any code to do this, just used Xcode with its
> Interface Builder. When the program starts I don't see the slider set to
> the "Current" position I'd like and the textField doesn't show the
> "Current" value either. Is there something I can do within Xcode or do I
> need to add a line of code somewhere (in a -WindowControllerDidLoadNib:
> somewhere, maybe)?

This usually happens because something in the keypath of the binding isn't KVO 
compliant.

For example, if your controls are bound to "model.myValue" of File's Owner, and 
the "model" property doesn't get set until after the nib is loaded and it isn't 
set KVO compliantly, then your controls will see "myValue" as 0.

If you can't spot a property that's obviously non-compliant, it's going to be 
necessary to take the key path apart property by property and verify that each 
is doing the right thing.

Where is the initial value coming from? One of the values you set in the 
slider, stepper or text field in IB, or something else?

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to