I am trying to exchange data between my main macOS application and the extension I created.
I saw that I should use "Application Groups" and exchange data with "UserDefault (package name:" name ")"
Problem: after including application groups in the main application and adding a name, I turned on application groups for the extension, and the list is empty, I don’t see the group I just created?
Any idea?
btw: command profiles are the same for both the application and the extension. I tried to delete the temporary file, clean the project, restore Xcode and the computer.

EDIT 1: Application groups detected in iOS project ....
EDIT 2: I tried with Xcode 9 but with the same problem .
EDIT 3: On the Apple Certificates, Identifiers and Profiles website, you don’t have the MacOS Application Groups category, is it out of date?
EDIT 4: If I add both group group names manually, I get an error:. [Custom default values] Failed to read values in CFPrefsPlistSource <0x6000000e4200> (Domain: 726328455Z.test, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null)): Using kCFPreferencesAnyUser with the container is allowed only for connecting to containers fromfref, ,
Edit 5: it looks like it works, data is successfully saved using this code
UserDefaults(suiteName: "7263xxx55Z.test")!.set(selectedRow, forKey: "selectedRow") UserDefaults(suiteName: "7263xxx55Z.test")!.synchronize()
And fetching with this code, I got the previous error, but I just ignore it
let selectedRow = UserDefaults(suiteName: "726xxx55Z.test")!.integer(forKey: "selectedRow")
xcode swift macos-sierra today-extension
user3722523 Jul 04 '17 at 21:40 2017-07-04 21:40
source share