UIDevice CFDictionaryGetValue error in background
I'm checking:
[[UIDevice currentDevice] systemName]
in applicationDidEnterBackground. This raises the EXC_BAD_ACCESS (SIGSEGV) signal. The stack trace shows that this is happening inside the UIDevice that calls CFDictionaryGetValue.
Experimentation, challenge:
CFDictionaryGetValue(NULL, "key");
results in the same error.
Any ideas? I have searched for documentation about accessing UIDevice in the background and have found nothing to indicate that this should be the problem.
thank
+3
source to share
1 answer
Calling (and logging) [[UIDevice currentDevice] systemName] on applicationDidEnterBackground: works fine in my test. CFDictionaryGetValue (NULL, "key") always fails and has nothing to do with the problem you are experiencing.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSString *systemName = [[UIDevice currentDevice] systemName];
if ( systemName )
NSLog(@"%@", systemName);
else
NSLog(@"null systemName");
}
0
source to share