I am trying to exchange data between my application and a custom keyboard extension. I have included application groups in both the main target program and the target user keyboard. In my main application, I add an object with the following:
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.mycompany.myapp"]; [userDefaults setObject:someObject forKey:@"KEY"];
A listing of the [userDefaults dictionaryRepresentation] in the console indicates that this object has been saved, and also calls [userDefaults objectForKey: @ "KEY"].
However, when I try to access this object in a custom keyboard extension:
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.mycompany.myapp"]; NSString *value = [userDefaults objectForKey:@"KEY"];
The value is nil, and the call to [userDefaults dictionaryRepresentation] does not show the record that was saved above. I'm on Xcode 6 beta 3. Any ideas?
UPDATE Fixed in Xcode 6 beta 5
source share