How to move slider according to text field value?

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

  1. mkristain macrumors regular

    Joined:
    Aug 18, 2011
    #1
    hello,

    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
    Code:
    	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

    LostSoul80

    Joined:
    Jan 25, 2009
    #2
    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

    Joined:
    Aug 18, 2011

Share This Page