MKiCloudSync
MKiCloudSync copied to clipboard
Bug
I see on your site there were several comments about keys being more than 64 utf8 chars. Have you resolved that issue?
I'm seeing this error in Flurry: NSInvalidArgumentException: NSUbiquitousKeyValueStore: key 'com.apple.audio.CoreAudio.HogMode.Owner-WM8758 Input Device audio0' is too long. Msg: Crash!
Turns out apple put loads of their own stuff in user defaults and some of the keys are too long for iCloud. Here is a quick fix.
+(void) updateToiCloud:(NSNotification*) notificationObject {
...
[dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([key rangeOfString:@"com.apple"].location == NSNotFound) {
[[NSUbiquitousKeyValueStore defaultStore] setObject:obj forKey:key];
}
}];
...
}
+(void) updateFromiCloud:(NSNotification*) notificationObject {
..
[dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([key rangeOfString:@"com.apple"].location == NSNotFound) {
[[NSUserDefaults standardUserDefaults] setObject:obj forKey:key];
}
}];
..