首页 > 代码库 > IOS 定时器

IOS 定时器

NSTimer *myTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(scrollTimer) userInfo:nil repeats:NO];

 

//关闭定时器
[myTimer setFireDate:[NSDate distantFuture]];

 

//开启定时器
[myTimer setFireDate:[NSDate distantPast]];

IOS 定时器