1
는이 코드를 사용하고 있습니다 :NSTimer 문제
timer = [NSTimer scheduledTimerWithTimeInterval:2
target:self
selector:@selector(update)
userInfo:nil
repeats:YES];
...
-(void)update {
NSDate *date = [NSDate date];
NSString *Currentdate = [date descriptionWithCalendarFormat:@"%b %d, %Y %I:%M:%S %p"
timeZone:nil
locale:nil];
lbl.text = Currentdate;
}
그것은 잘 작동하지만 런타임에 일초 2 초 타이머 간격을 변경하고 싶습니다. 어떻게해야합니까?
미리 감사드립니다.
scheduledTimerWithTimeInterval : 1 대신 2? – diciu
나는 타이머가 생성 된 후 타이머의 간격을 어떻게 바꿀지 알고 싶어한다고 생각한다. – jhauberg