我在更新标签时遇到了问题...它不会删除旧值,所以新值会覆盖旧值...如果您能提供帮助,将不胜感激...
timer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateLabels)
userInfo:nil
repeats:YES];
-(void) updateLabels{
for (GraphView *graph in arr){
// retrieve the graph values
valLabel = [[UILabel alloc] initWithFrame:CGRectMake(i * 200, 0, 90, 100)];
valLabel.textColor = [UIColor whiteColor];
valLabel.backgroundColor = [UIColor clearColor];
valLabel.text = [NSString stringWithFormat:@"Value: %f", x];
i++;
}
}