How to move slider according to text field value?

Discussion in 'Mac Programming' started by mkristain, Sep 4, 2011.

  1. mkristain macrumors regular

    Aug 18, 2011

    i am using slider and a text field when i move or drag the slider than i got its value and display in text field
    	float sliderValue = [ slider floatValue ];
    	[TextField setStringValue:[NSString stringWithFormat:@"%.1f", sliderValue ]];
    but when i try opposite of this,means enter some value in text field and trying slider move according to this value but

    - (void) controlTextDidChange:(NSNotification *)obj

    event not generated thats why slider not move with text field values .

    so please can anyone help me how can i move the slider according to enter value in text field and how can i set the limit in this text filed to enter only numbers and must me less that text length of 4 digit.

    please guide me for this.

    thanks in advance.
  2. LostSoul80 macrumors 68020


    Jan 25, 2009
    Read the documentation. I'm sorry, but that's something you can accomplish just by spending 2 minutes reading it.
  3. mkristain thread starter macrumors regular

    Aug 18, 2011

Share This Page