//定时检查用户的各种消息未读数(每隔5秒钟)
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(checkUnreadCount) userInfo:nil repeats:YES];
//放到子线程
[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
iOS使用定时器,并添加到子线程运行
最新推荐文章于 2023-10-25 16:51:17 发布