Help Please. Everytime when I touch my UIButton, my label should increase existing number (1,2,3,4…) if my UIImageView.image = image1.png and I press at that time my UIButton, my label should decrease -10. Decreasing and Increasing works, but if I deacrease for example from 34 to 24, next time when i press to increase, it increase from 34 not from existing 24.
Here is my code:
if (UIImageView.image == [UIImage imageNamed:@"image1.png"]) {
NSString *dataMinus = [NSString stringWithFormat:@"%i",scoreIncrease - 10];
[self.label setText:dataMinus];
}
else {
NSString *dataToSend = [NSString stringWithFormat:@"%i",scoreIncrease++];
[self.label setText:dataToSend];
}
Help to fix that, please.
try this may help U.