mercredi 25 mars 2015

Apple Watch Data Share

i'm facing a issue when trying to share data between Apple Watch and iPhone (both on simulator).


That's how i'm storing the data on my iPhone App:



NSUserDefaults* defaults = [[NSUserDefaults alloc]initWithSuiteName:@"group.com.myapp"];
[defaults setObject:@"TEST" forKey:@"testKey"];
[defaults synchronize];


And that's how i'm trying to retrieve the data on my watch App:



NSUserDefaults* defaults = [[NSUserDefaults alloc]initWithSuiteName:@"group.com.myapp"];
NSLog(@"%@",[defaults objectForKey:@"testKey"]);


It just returns NULL


I've configured the "appGroups" already, and my entitlements file looks like this:enter image description here


I've tried everything i could, but i couldn't get this to work... Can somebody help me with that?


Thank you very much!




Aucun commentaire:

Enregistrer un commentaire