2017-05-18 4 views

答えて

1

NSTimerのtimeIntervalはreadOnlyとなり、直接変更することはできません。 timeIntervalを変更する方法は、次のようにタイマーを再定義します。

- (void)changeTimeIntervalWithInterval:(NSInteger)timeInterval{ 

if (self.timer) { 
    [self.timer invalidate]; 
    self.timer = nil; 

    self.timer = [NSTimer scheduledTimerWithTimeInterval:timeInterval target:self selector:@selector(printHH) userInfo:nil repeats:YES]; 
} 
} 
関連する問題