开发者

Interface builder bindings only working in one direction?

I've got an XIB window that I'm working with in Interface Builder. It has an NSScroller and 4 popups. The controller class has a float and 4 ints.

I bound the scroller to the float and the pupups to the ints, binding the value of the scroller and the selected index of the popups.

When I move the scroller, or change the popup selection, the ints and float change exactly as expected.

However, when I change the ints a开发者_开发技巧nd float in the code (To initialize them for example) the UI elements don't change.

All of the ints and float are properties, properly synthesized.

Am I missing something really dumb?


There could be one of several things wrong.

First, by "binding" do you mean that you are using Cocoa bindings? If so, do you have an Object Controller in the NIB file that arbitrates between your UI elements and your data holding code? That is generally required.

When you say "when I change the ints and floats in code", how are you changing them? If you are setting the instance variables directly, you are bypassing any change monitoring mechanisms.

Post some code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜