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++;
}
THX
[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;'タイマーはメインスレッド上に作成されていますか?あなたは火の方法が実行されていることは確かですか? –