NSUserDefault crash issue
NSUserDefault crash issue
- Subject: NSUserDefault crash issue
- From: Arjun SM <email@hidden>
- Date: Fri, 10 Jan 2014 19:17:35 +0530
Hi all,
I am having a crash issue when i am trying to set the dictionary for
persistent domain.
*Scenario*
When user logs in to my application, my app receives a few settings from a
server which is updated to NSMutableDictionary.
After updating the dictionary , I set the the values for the domain using
below code,
- (void) saveUserDefaults;
{
[[NSUserDefaults standardUserDefaults]
removePersistentDomainForName:[[NSBundle
bundleForClass: [self class]] bundleIdentifier]];
[[NSUserDefaults standardUserDefaults] setPersistentDomain:profileDefaults
forName:[[NSBundle bundleForClass:[self class]] bundleIdentifier]];
[[NSUserDefaults standardUserDefaults] synchronize];
}
However I see crashes as below which is not consistently reproducible,
Attempt to set a non-property-list object as an
NSUserDefaults/CFPreferences value
abort() calledThread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x98cef952 __pthread_kill + 10
1 libsystem_pthread.dylib 0x90852167 pthread_kill + 101
2 libsystem_c.dylib 0x9a783340 abort + 155
3 com.apple.CoreFoundation 0x9b6ad26b -[CFPrefsPlistSource
alreadylocked_setValue:forKey:] + 203
4 com.apple.CoreFoundation 0x9b657ef4 -[CFPrefsSource
alreadylocked_setValues:forKeys:count:] + 68
5 com.apple.CoreFoundation 0x9b7d4f40 ___
CFXPreferencesReplaceValuesInSourceWithBundleID_block_invoke_2 + 96
6 com.apple.CoreFoundation 0x9b65dd39 +[CFPrefsSource
withSourceForIdentifier:user:byHost:container:perform:] + 969
7 com.apple.CoreFoundation 0x9b7d4ecc
___CFXPreferencesReplaceValuesInSourceWithBundleID_block_invoke
+ 140
8 com.apple.CoreFoundation 0x9b65754c doSetValuesInSourceWithKVO + 348
9 com.apple.CoreFoundation 0x9b7d4e35 _
CFXPreferencesReplaceValuesInSourceWithBundleID
+ 101
10 com.apple.Foundation 0x939fc745
-[NSUserDefaults(NSUserDefaults)
setPersistentDomain:forName:] + 250
Any help would be greatly appreciated.
thanks,
~Arjun
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden