ОК, мне нужна помощь.
Я пытаюсь добавить значения метки. То есть. buttonpLabel = 10, rbuttonLabel = 2
Я думал, что смогу как-то найти значение для self.buttonfLabel.text и добавить их в self.rbuttonLabel.text.
Я хочу представить ответ в wLabel
Я просто не могу понять семантику .....
Есть идеи?
J
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
NSNumber *newValue = [change valueForKey:NSKeyValueChangeNewKey];
NSNumber *supertotals;
// change gives back an NSDictionary of changes
// update the appropriate label
if (keyPath == @"buttonf") {
self.buttonfLabel.text = [newValue stringValue];
}
else if (keyPath == @"rbutton") {
self.rbuttonLabel.text = [newValue stringValue];
}
else if (keyPath == @"pbutton") {
self.pbuttonLabel.text = [newValue stringValue];
}
/////////////below does not work.....
supertotals = [numberWithInt:[bbuttonLabel.text intValue]]+[numberWithInt:[buttonp Label.text intValue]];
self.wLabel.text = [supertotals stringValue];