2013-11-25 35 views

回答

2

我想你想要做那樣的事情?

if ([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusAvailable) { 

    NSLog(@"Background updates are available for the app."); 
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusDenied) 
{ 
    NSLog(@"The user explicitly disabled background behavior for this app or for the whole system."); 
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusRestricted) 
{ 
    NSLog(@"Background updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user."); 
} 
相關問題