MKiCloudSync icon indicating copy to clipboard operation
MKiCloudSync copied to clipboard

Bug

Open LittleOrangeC opened this issue 12 years ago • 1 comments

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!

LittleOrangeC avatar Jul 24 '13 00:07 LittleOrangeC

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];
        }
    }];
..

swaterfall avatar Dec 02 '13 12:12 swaterfall