Reputation: 1414
I wish to call the function persistentStoreCoordinator.destroyPersistentStoreAtURL(...)
. I'm creating my container with it like this NSPersistentContainer(name: "MyProject")
what I would like to know is how to get the URL of the persistentStore for use in the first call, in Swift preferably.
Many thanks.
Upvotes: 3
Views: 1454
Reputation: 2419
The NSPersistentContainer
has a persistentStoreDescriptions
property.
That array describes the stores loaded in the coordinator, including their URL.
Upvotes: 6