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

 

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

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

posted @ 2016-02-24 10:54  鸿鹄当高远  阅读(935)  评论(0编辑  收藏  举报