首次启动时无法识别iCloud KeyValue存储 [英] iCloud KeyValue store not recognized on first launch

查看:148
本文介绍了首次启动时无法识别iCloud KeyValue存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用iCloud(键值存储)在多个设备之间同步唯一ID.这项工作在应用程序首次启动时就已经真正起作用了.似乎只有在该应用安装并运行了一段时间后,该设备才首次启动时仍不熟悉iCloud的值.

My app uses iCloud (key-value store) to sync an unique id between multiple devices. This works accept at the point were it really has to work, at the first launch of the app. It looks like the device isn't yet familiar with the values from iCloud at first launch, only after the app is installed and has been running for a while.

我在应用程序主视图的viewDidLoad函数中检查iCloud值.

I check for the iCloud value in the viewDidLoad function on main view of the app.

所以,我的问题:

  • 这是预期的行为吗?
  • 如果是,还有其他解决方法吗?
  • 是否可能仅在从Xcode运行而不是出厂版本时出现问题?如果是,该如何测试?

谢谢!

碧玉

推荐答案

首次运行启用iCloud的应用程序时,它必须从Apple服务器中提取所有数据.花费的时间取决于许多因素,例如您当前所处的网络类型(Edge,3G,GPRS,WLAN).这也取决于iCloud服务器当前必须处理多少流量,因此,无论您使用哪种类型的网络连接,对iCloud服务器的请求都可能需要花费几秒钟的时间.

When you first run an iCloud enabled App it has to pull all the data from Apple servers. The time it takes to do so depends on many things like what kind of network you're currently on (Edge, 3G, GPRS, WLAN). It also depends on how much traffic the iCloud server currently has to handle so the request to the iCloud server may take a few more seconds, no matter what type of network connectivity you have.

总结:是的,这听起来绝对是正常的.

To sum it up: Yes, it sounds absolutely normal.

如果运行您的App取决于这些设置,请考虑实施停留在屏幕上的等待"或加载"视图,只要该应用执行初始同步并从云中加载所有需要的数据即可.为了不永远阻止UI,还应为此视图实现超时(如果iCloud数据在X秒内未加载,请关闭该视图并通知用户).

If running your App depends on those settings consider implementing a "Wait" or "Loading" view that stays on the screen as long as it takes for the App to perform a initial synch and load all needed data from the cloud. To not block the UI forever also implement a timeout for this view (if iCloud data not loaded within X seconds, dismiss the view and notify user).

这篇关于首次启动时无法识别iCloud KeyValue存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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