How to keep NSTimer alive in Background on iOS 7?

后端 未结 4 705
情书的邮戳
情书的邮戳 2021-01-01 03:35

I have created Application which runs NSTimer in Background. I used the Location manager to run the NSTimer in background,

I used below link to run NSTimer in backgr

4条回答
  •  旧巷少年郎
    2021-01-01 04:13

    [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
    loop = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(Update) userInfo:nil repeats:YES];
    [[NSRunLoop currentRunLoop] addTimer:loop forMode:NSRunLoopCommonModes];
    

提交回复
热议问题