问题
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