Reputation: 31
I am trying to find the sqlite file location created by core data. I am using the below code:
print("Documents Directory: ", FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last ?? "Not Found!")
And it's showing me the result: ile:///var/mobile/Containers/Data/Application/148690BC-21F4-4239-99B2-5F947023B414/Library/Application Support
But I can't find any sqlite file in the location.
Can any one please help me to solve the issue. I am using Swift 4 and testing my code in iPhone 6sPlus
Upvotes: 3
Views: 2301
Reputation: 5020
Unless your app is document-based, the default location for your app's sqlite database is its Application Support directory, not Documents. Change .documentDirectory
to .applicationSupportDirectory
.
Upvotes: 1