Reputation: 339
I have enabled App Group and created a group called "group.com.classData"
And my code looks like this:
let plistPath3 = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.classData")
print(plistPath3) //returns "nil"
And it returns nil. Why does that happen?
Upvotes: 5
Views: 2444
Reputation: 11
it take my 4 hour to solve it.. in my post pic
Upvotes: 1
Reputation: 16089
I ran into this error while developing a share extension. It turned out that while I had added the App Group entitlement to the app’s target, I hadn’t added it to the extension’s target. I needed to select the extension from the project/target dropdown list:
Then I clicked on the Capabilities tab and enabled App Groups. The App Group I had created for the application was already in the list; I just needed to check its checkbox. When I ran the app again, containerURL(forSecurityApplicationGroupIdentifier:)
returned a non-nil value.
Upvotes: 3