定时器 NSTimer
开始
if (_timer==nil) {
_timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(startFly) userInfo:nil repeats:YES];
}
暂停
if (_timer!=nil) {
//定时器暂
[_timer setFireDate:[NSDate distantFuture]]
}
继续
if(_timer){
//定时器继续
[_timer setFireDate:[NSDate distantPast]];
}
停止
//停止定时器,销毁定时器
if (_timer) {
[_timer invalidate];
_timer = nil;
}