[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(dealTimerClick) userInfo:nil repeats:YES]; 可以看下这个方法在文档中的描述: Creates and returns a new NSTimer object and schedules it on the current run loop in the default mode. 主线程没有问题是因为主线程有自己的run loop,所以我想你在子线程上运行的时候需要自己配置下run loop。
用
[NSTimer timerxxx]
那个方法创建 timer ,然后:楼也也讲了,是次线程中 run loop 的问题
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(dealTimerClick) userInfo:nil repeats:YES];
可以看下这个方法在文档中的描述:
Creates and returns a new NSTimer object and schedules it on the current run loop in the default mode.
主线程没有问题是因为主线程有自己的run loop,所以我想你在子线程上运行的时候需要自己配置下run loop。
记得在fire方法里面加入信号量控制