当前位置: 代码迷 >> Iphone >> 解决定时器在主线程不工作的有关问题
  详细解决方案

解决定时器在主线程不工作的有关问题

热度:250   发布时间:2016-04-25 05:22:32.0
解决定时器在主线程不工作的问题

 

NSTimer *timer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(someAction) userInfo:nil repeats:YES];

[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];

  相关解决方案