Value from UISlider method?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-06-09T18:40:32Z Indexed on 2010/06/09 18:52 UTC
Read the original article Hit count: 223

Filed under:
|
|

Can anyone point me in the right direction regarding sliders, the version below was my first attempt (the range is 0.0 - 100.0) The results I get are not right.

// Version 1.0
-(IBAction)sliderMoved:(id)sender {
    NSLog(@"SliderValue ... %d",(int)[sender value]);
}

// OUTPUT:
// [1845:207] SliderMoved ... -1.991753
// [1845:207] SliderMoved ... 0.000000
// [1845:207] SliderMoved ... 0.000000
// [1845:207] SliderMoved ... 32768.000435

With the version below I get the values I expect, what am I missing in version_001?

// Version 2.0
-(IBAction)sliderMoved:(UISlider *)sender {
    NSLog(@"SliderValue ... %d",(int)[sender value]);
}

// OUTPUT:
// [1914:207] SliderMoved ... 1
// [1914:207] SliderMoved ... 2
// [1914:207] SliderMoved ... 3
// [1914:207] SliderMoved ... 4

cheers Gary

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c