Ios6 为什么抛出异常是Can';t endBackgroundTask不存在标识符为的后台任务,或者该任务可能已结束。
无法结束后台任务:不存在标识符为48fcd6的后台任务,或者该任务可能已结束。中断UIApplicationEndBackgroundTaskError()以进行调试 我试过的就在这里Ios6 为什么抛出异常是Can';t endBackgroundTask不存在标识符为的后台任务,或者该任务可能已结束。,ios6,Ios6,无法结束后台任务:不存在标识符为48fcd6的后台任务,或者该任务可能已结束。中断UIApplicationEndBackgroundTaskError()以进行调试 我试过的就在这里 - (void)applicationDidEnterBackground:(UIApplication *)application { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- (void)applicationDidEnterBackground:(UIApplication *)application
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *myString = [prefs stringForKey:@"getTime"];
int timeInterval = [myString integerValue];
intervalForTimer = timeInterval;
[timer invalidate];
timer=nil;
timer = [ NSTimer
scheduledTimerWithTimeInterval:intervalForTimer
target:self
selector:@selector(startCoreUpdate)
userInfo:nil
repeats:YES
];
//change to NSRunLoopCommonModes
[ [NSRunLoop currentRunLoop]
addTimer:timer
forMode:NSRunLoopCommonModes
];
[[NSRunLoop currentRunLoop] run];
});
UIBackgroundTaskIdentifier back =
[[UIApplication sharedApplication]
beginBackgroundTaskWithExpirationHandler:^{
[self startCoreUpdate];
[ [UIApplication sharedApplication]
endBackgroundTask:back
];
} ];
}
-(void) startCoreUpdate{
notification=[[AlertNotificationViewController alloc]init];
[notification recentUpdatesVideo];
}
所以我的问题是为什么我会收到这个错误/警告。有没有解决办法,因为这会中断我的通知计时器,并且计时器在实际计时器时间之前被触发