后台短时间内运行定时器
2018-05-03 本文已影响2人
Luyc_Han
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(recordingTime) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];