HELP wanted (CGRotation)

Discussion in 'Mac Programming' started by ucool, May 17, 2007.

  1. ucool macrumors newbie

    Joined:
    May 17, 2007
    #1
    in apple cocoa sample code CGRotation, how SSlider connect with setRotation? anyone have idea?
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. ucool thread starter macrumors newbie

    Joined:
    May 17, 2007
    #3
    In fact, i found in definition it is as:
    ...
    {
    float rotation;
    }
    - (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.
     
  4. ucool thread starter macrumors newbie

    Joined:
    May 17, 2007
    #5
    Thank you for your post. I knew now. It is a naming thing. I mean in my code, I have
    float abc;
    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.
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    Personally I don't like bindings, and that is just one of the reasons.

    NSUserDefaultsController is the only part of bindings I use normally.
     

Share This Page