2017-04-22 1 views
-4

ici mon code:

- (void)viewDidLoad { 

    [super viewDidLoad]; 

[_stepperName addTarget:self action:@selector(stepperMethodName) forControlEvents:UIControlEventValueChanged]; 

} 

-(void)stepperMethodName { 

    _labelToDisplay.text = [NSString stringWithFormat:@"%f", _stepperName.value]; 

    NSLog(@"%f", _stepperName.value); 
} 

Thankyou.

Répondre

-1
- (void)viewDidLoad { 

    [super viewDidLoad]; 

[_stepperName addTarget:self action:@selector(stepperMethodName) forControlEvents:UIControlEventValueChanged]; 

} 

-(void)stepperMethodName { 

    _labelToDisplay.text = [NSString stringWithFormat:@"%.1f", _stepperName.value]; 

    NSLog(@"%.1f", _stepperName.value); 
} 

//Upto two decimal Places @"%.2f" 

//Upto three decimal Places @"%.3f"