I currently have my CoreData-iCloud setup working. Every time the user adds/deletes/edits entires in one of his devices, the changes are synced to iCloud (if available) and then pushed to his other devices when he opens the app.

Unfortunately, iCloud is not instantaneous. When the user opens the app in his second device, it takes 10~20 seconds on a solid connection for the synced data to appear.

Is there any way to detect when the application connects with iCloud, to inform the user that there's actually something going on, and the app is working (show a little spinner somewhere)?

At least to be able to manually trigger an iCloud update via pull to refresh, or something. It would be awesome being able to show the user something that tells him "your data is on your way, hold a little longer".

Thanks.

有帮助吗?

解决方案

Take a look at these sample apps, they use the status of log files in iCloud to determine when upload or download activity is underway.

http://ossh.com.au/design-and-technology/software-development/sample-library-style-ios-core-data-app-with-icloud-integration/

其他提示

There's no documented API for checking the status of transaction logs with CoreData-iCloud. There's definitely no way to "trigger" an iCloud update, but to check pending data, you might be able to hack together something using NSMetadataQuery and iCloud KVS, but it's also going to be imprecise and unpredictable. Hopefully this is added in iOS8 (you might want to file a Radar while you're at it).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top