开发和生产模式下有关CoreData的iCloud更新策略 [英] iCloud update policy on CoreData in development and production mode

查看:121
本文介绍了开发和生产模式下有关CoreData的iCloud更新策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如本主题中所述,我正在开发一个使用CoreData及其内置iCloud功能的应用程序.

as specified in the subject I am developing un application that made use of CoreData and its built in iCloud feature.

每当我将设备(iPad和iPhone)连接到xcode并运行该应用程序时,几分钟后我都可以看到CoreData更新数据的日志.在"iCloud上的两个设备"部分中,我可以看到我的应用程序拥有完整的iCloud标题. 第一个问题:iCloud内容多久被推送到设备一次?有办法强制吗?

Whenever I connect my devices (an iPad and an iPhone) to xcode and run the application, I can see after few minutes the log of CoreData updating data. In both devices on iCloud section, I can see my application full entitled for iCloud. First question: how often are iCloud content pushed (or pulled) to devices ? Is there a way to force this ?

第二,我注意到设备一旦与Xcode断开连接,就不再更新其数据. 如果再次插入并运行应用程序,则数据将更新. 所以问题是,处于开发模式(应用尚未提交到App Store)的iCloud是否只能通过xcode运行,如果是,为什么? 还是我在Objective-C代码本身中做错了什么?

Second, I noticed that the devices, once disconnected from Xcode, doesn't update their data anymore. While if plugged again and run the app, the data get updated. So the question, is iCloud in development mode (the app is not yet submitted to App Store) working only trough xcode, and if yes why ? Or am I doing something wrong within the objective-c code itself ?

谢谢

推荐答案

每当您保存CoreData moc时,更新就会推送到iCloud服务器. 更新会自动从iCloud推送到设备.据我所知,没有办法强制执行.

The updates are getting pushed to iCloud servers whenever you save CoreData moc. The updates are getting pushed from iCloud to device automatically. There's no way to force it as far as I know.

从iCloud进行更新可能需要几秒钟到几十分钟的时间才能显示在您的设备上(还取决于您的连接速度).苹果公司不保证它什么时候会发生.

It can take from seconds to dozens of minutes for an update from iCloud to appear on your device (also depends on your connection speed). Apple doesn't give any guarantees on when it will actually happen.

无论应用程序是否从XCode启动,我都没有看到iCloud行为方面的差异.根据iCloud推送检查代码和UI更新.

I haven't seen any difference in iCloud behavior whether app started fom XCode or not. Check your code and UI updates base on iCloud pushes.

这篇关于开发和生产模式下有关CoreData的iCloud更新策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆