Reputation: 11257
I've seen other questions asking the same thing and they're all marked as "answered" but the answers they provide are not working for me.
I created a base cocoa application in Xcode 5 and made it a Core Data/Document app. I added a few entries to Core Data and can see them in NSLog when I read them back... now where is my sqlite DB located?
I checked: ~/Library/Containers/
And my app is not there.
I checked: ~/Library/Developer/XCode/DerivedData/
And I found my app there, but I went through every single folder and can't find the SQLite at all.
Can anyone tell me where this is at? This is a Mac OSX app, not an iOS app.
Upvotes: 3
Views: 2303
Reputation: 70936
The data store file is... Wherever you put it. The location is not automatically generated, it's wherever your code says it should be. Specifically, when you call addPersistentStore:
, you pass in a file URL that determines the location. Find that call and see what path it's using.
Commonly, but not always, this is in the Application Support folder. If your app is sandboxed then that's somewhere in ~/Library/Containers/
. If your app is not sandboxed then it's somewhere in ~/Library/Application Support/
.
But the store doesn't have to be in Application Support. It can be anywhere that your app has file write privileges. If your app isn't sandboxed, it could go anywhere that the current user has file write privileges. It's wherever you tell Core Data to put it.
Upvotes: 9