I have two UILabels that shows numbers. They are updated through UISteppers. I would like to include a third UILabel that calculates the division between UILabel1 and UILabel2 when the user presses on either of the UISteppers. (The two UILabels are therefore .text)
I know the method should be done if both the IBAction of the two UISteppers but I am having trouble thinking how the method should be written.
Does somebody have any idea how to write the method?
Thanks.
to update UILabel1
- (IBAction)smashChanged:(id)sender {
self.smashLabel.text = [NSString stringWithFormat:@"%d",
[[NSNumber numberWithDouble:[(UIStepper *)sender value]] intValue]];
}
You can use the method
floatValue(orintValue) ofNSString: