mugunthkumar / mkicloudsync Goto Github PK
View Code? Open in Web Editor NEWSync your NSUserDefaults to iCloud automatically
Sync your NSUserDefaults to iCloud automatically
Hi Guys,
Not really an issue but more of an improvement.
I have my app sync on start, so it's nice to have a function/notification SyncStarted to know when the sync with iCloud has started. That way we can show a loading message overlay until all the data is grabbed from iCloud and then updated within the app.
I tried pushing a new notification inside updateFromiCloud but the sync starts before that get's called.
Thanks
This class can really be improved according to the documentation: http://developer.apple.com/library/iOS/documentation/Cocoa/Conceptual/UserDefaults/StoringPreferenceDatainiCloud/StoringPreferenceDatainiCloud.html#//apple_ref/doc/uid/10000059i-CH7-SW2
Seems like the same issue that showed up at MugunthKumar/MKStoreKit#49
I was wondering if that fix can be applied to MKiCloudSync ?
When I go to XCODE5 with iOS7 , It always keep complaining that NSUbiquitousKeyValueStore error: com.*** has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
And it does not work, anyone has the same issue or any clues to fix it ? Thanks
In the docs for NSUbiquitousKeyValueStore it states:
Important When you register for the NSUbiquitousKeyValueStoreDidChangeExternallyNotification notification, always specify the default key-value store object as the object of the notification.
Hey, your code seems very interesting and I would like to use it in my app but I've been wondering how can I detect if a key is uploading or downloading through iCloud? I'm not sure that you have implemented any thing of that sort but I might be mistaken due to my poor Objective-C skills.
I hope you can respond and thanks for this great code!
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!
I imported the MKiCloudSync files and it has been working fine for months. Now, I don't know why, it doesn't sync NSUserDefaults across devices with same iCloud account enabled. If i run the application on different devices of the simulator it works fine.
Where am I wrong? Because it worked fine until now; I also checked my iCloud storage and I have got 4.3 Gb out of 5.
Let's say I've got 10 Boolean NSUserDefaults labeled from 1 to 10 and the first 3 are set as true while the others are set as false.
If I delete the app from my iPhone and reinstall it I'll get them back exactly as they was but if I edit them, delete the app and reinstall it, I'll get the situation before editing them (1-2-3 true, others false)
It seems MKiCloudSync can only download NSUserDefaults and can't upload the edited ones.
Any ideas? Thanks really much.
Simone.
DOES ANYONE KNOW HOW LONG THIS IS KEPT ALIVE?
SOMETIMES I FELT LIKE THE CLASS STOPPED WORKING,
HOWEVER AFTER IMPLEMENTING DEALLOC,
THE IMPLEMENTED LOG NEVER APPEARED FOR ME.
Love the idea, but I think this class is fatally flawed. It appears to set every item of the standardUserDefaults to iCloud, some which are not user created and thus unnecessary--WebKitWebSecurityEnabled, WebKitUsesEncodingDetector, and so on ad infinitum. For my app, it has caused a confusing crash due to having either too many keys or having improper names for keys.
stacktrace:
Last Exception Backtrace:
0 CoreFoundation 0x1861f709c __exceptionPreprocess + 132
1 libobjc.A.dylib 0x192175d78 objc_exception_throw + 60
2 CoreFoundation 0x1861f6fdc +[NSException raise:format:] + 128
3 SyncedDefaults 0x18e72e0a4 __46-[SYDRemotePreferencesSource setValue:forKey:]_block_invoke + 348
4 libdispatch.dylib 0x1927443e0 _dispatch_client_callout + 16
5 libdispatch.dylib 0x192749f2c _dispatch_barrier_sync_f_invoke + 48
6 SyncedDefaults 0x18e72df3c -[SYDRemotePreferencesSource setValue:forKey:] + 92
7 Foundation 0x186e3103c __46-[NSUbiquitousKeyValueStore setObject:forKey:]_block_invoke + 56
8 libdispatch.dylib 0x192744420 _dispatch_call_block_and_release + 24
9 libdispatch.dylib 0x1927443e0 _dispatch_client_callout + 16
10 libdispatch.dylib 0x19274a6f0 _dispatch_queue_drain + 544
11 libdispatch.dylib 0x192746884 _dispatch_queue_invoke + 68
12 libdispatch.dylib 0x19274b3a8 _dispatch_root_queue_drain + 316
13 libdispatch.dylib 0x19274b638 _dispatch_worker_thread2 + 76
14 libsystem_pthread.dylib 0x1928d9918 _pthread_wqthread + 356
15 libsystem_pthread.dylib 0x1928d97a8 start_wqthread + 4
im not sure if its mkicloudsync but i think it is
Ca you add a function to sync app's Documents folder in its sandbox?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.