У меня есть IBAction UILabel, чтобы добавлять число при каждом нажатии. У меня есть Total UITextField, который добавляет все 3 UILabels. Похоже, что получено общее количество, пока я не нажму кнопку UILabel вычитания (buttonTap2).
Вот пример не работающего кода IBAction UILabel:
- (IBAction)buttonTap2:(id)sender {
int value = [currentLabel.text intValue] - 1;
currentLabel.text = [NSString stringWithFormat:@"%d",value];
int n1 = [label2.text intValue]; // total labels
int n2 = [label3.text intValue];
int n3 = [label4.text intValue];
int s = n1 - n2 - n3;
NSString *sn = [NSString stringWithFormat:@"%d",s];
[tex7 setText:sn];