IOS ( Object-C )
[IOS] - IOS Timer 아이폰 타이머 사용법
Vivara
2014. 9. 3. 17:11
반응형
NSTimer *_timer;
- (void) setTimer {
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:5
target:self
selector:@selector(startTimer:)
userInfo:nil
repeats:YES];
_timer = timer;
}
- (void) startTimer : (NSTimer *) timer {
[chatMessageController getMessageData];
}
- (void) stopTimer {
if( _timer != NULL ) {
[_timer invalidate];
_timer = NULL;
}
}
반응형