Search code examples
iphoneipadicloud

How to forcefully fetch key-value from iCloud?


In my application I am storing username and password in iCloud key value store. On first launch I am calling synchronize to fetch data from iCLoud but there is a delay. Is there any way to forcefully fetch the data in iCloud?


Solution

  • I do this by setting a fake iCloud key-value immediately after initialization, like:

        NSUbiquitousKeyValueStore *kvStore = [NSUbiquitousKeyValueStore defaultStore];
        [kvStore setObject:@"th" forKey:@"KVTickle"];