后台短时间内运行定时器

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];
上一篇下一篇

猜你喜欢

热点阅读