2
iPhone에서 UILabel : "lbl"업데이트가 적용되지 않는 이유는 무엇입니까?반복되는 NSTimer에서 UILabel을 업데이트 할 수 없습니까?
... 방법 내에서 :
myTimer =[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(displayDataTimer) userInfo:nil repeats:YES];
...
-(void) displayDataTimer{
NSString *temp = [textField1 text];
[lbl setText:[NSString stringWithFormat:@"%d %d", j, genValue]];
//[self.view setNeedsDisplay:YES];
j++;
}
들으
[timer fire methods] (http://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Timers/Articles/usingTimers.html#//apple_ref/doc/uid/20000807-SW1)에 유의하십시오. 매개 변수가 없어야합니다. 그들은 다음과 같이 보일 것입니다 :'- (void) displayDataTimer : (NSTimer *) tim;'메인 스레드에서 타이머가 생성되고 있습니까? 화재 법이 시행되고있는 것이 확실합니까? –