上传者: 39840588
|
上传时间: 2021-11-29 11:13:21
|
文件大小: 2.11MB
|
文件类型: -
外挂: 将代码 /*设置定时器*/
_timer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(play) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop]addTimer:_timer forMode:NSDefaultRunLoopMode];
改为:
/*每秒刷新60次的定时器*/
_time = [CADisplayLink displayLinkWithTarget:self selector:@selector(play)];
/*将定时器添加到应用循环中*/
[_time addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];