Is it possible to use NSUbiquitousKeyValueStore within the iOS 7 or iOS 8 Simulator?

怎甘沉沦 提交于 2019-12-23 21:08:41

问题


I'm trying to test an app that uses iCloud key-value storage. Everything is working on a physical device, but the key-value storage doesn't save anything using the simulator.

From what I understand based on this documentation, iCloud testing is possible on the simulator and this should work. (btw, I've configured iCloud on the simulator)

I'm using Xamarin / Monotouch with the following code:

var store = NSUbiquitousKeyValueStore.DefaultStore;
store.SetString ("TestKey", "test123");
store.Synchronize ();

When reading the value immediately afterward or later, the value is always null.

var store = NSUbiquitousKeyValueStore.DefaultStore;
var testValue = store.GetString ("TestKey");
//*** testValue always null using the simulator ***

Is it possible to test iCloud key-value storage in the iOS simulator?

来源:https://stackoverflow.com/questions/27308169/is-it-possible-to-use-nsubiquitouskeyvaluestore-within-the-ios-7-or-ios-8-simula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!