저는 학생 예산 신청서를 작성 중입니다. 그리고, 사용자가 새로운 경비를 추가했을 경우, 모든 경비의 액을 나타내는 라벨이 갱신해야 합니다만, 그렇지 않습니다. debuger 총에서업데이트 UILabel, NSNumber에서 가치를 얻으십시오
float currentValue = [self.total floatValue];
self.total = [NSNumber numberWithFloat:(currentValue + amountValue)];
self.label.text = [NSString stringWithFormat:@"Razem: %@", total];
는 적절한 값을 가진다. 물론
나는이
self.label.text = [NSString stringWithFormat:@"something different"];
라벨과 같은 자신의 컨텐츠를 변경 입력 할 때.
EDIT.
내가 변경 한 코드 :
self.label.text = [NSString stringWithFormat:@"Razem: %@", [total stringValue]];
하지만 한 번만 업데이트합니다. 그래서, 당신이 부동 (또는 이중)를 인쇄하려면 YT
편집 할 수 있습니다. 코드를 변경했습니다 : \t self.label.text = [NSString stringWithFormat : @ "Razem : % @", [total stringValue]]; 하지만 한 번만 업데이트됩니다. 나는이 기록했습니다 [YT]을 [1] [1] : http://www.youtube.com/watch?v=tEr347-V6WU – milijkovic
편집 내 answer.try이 저에게 결과를 알려줍니다. – iPhoneDev
도움이되지 않습니다. 같은 결과 – milijkovic