Separate names with a comma.
Discussion in 'Mac Programming' started by ucool, May 17, 2007.
in apple cocoa sample code CGRotation, how SSlider connect with setRotation? anyone have idea?
Through bindings. It is binded to "rotation"
View attachment 74471
In fact, i found in definition it is as:
- (void) setRotation: (float) r;
- (float) rotation;
And in Inteface Builder it bind the NSSlider to rotation
Usually in order to connect NSSlider and setRotation, I set
-(IBAction) setRotation: (float) r; and then connect NSSlider and setRotation in Inteface Builder
But in this sample, it does not do like this usual way. I think they configure something in Inteface Builder, but i dont know how.
Read up on Bindings
Thank you for your post. I knew now. It is a naming thing. I mean in my code, I have
so I need
-(void ) setAbc: (float) a;
it is setAbc but setabc
I hate this in mac programming at this point. a typo can waste my a day.
Thank you again.
Personally I don't like bindings, and that is just one of the reasons.
NSUserDefaultsController is the only part of bindings I use normally.