1

With the particular app I am working on, I have a significant amount of data that I need to have in my db so I can read it in. I also have the need to write a few things to the db. I took a copy of the sqlite db out of the documents folder and put it into my main bundle and can read my manually inserted data without problems.

I am now trying to insert data, but I am running into difficulty. I remember reading somewhere that you can't write to a db in the main bundle? Only the documents folder? Is that correct? What are my options if I need to have custom data in a core data db that I also need write to?

Should I move it out of the main into the documents folder?

Thanks!

Jerry
  • 537
  • 1
  • 9
  • 16

1 Answers1

0

I can't find documentation to back this up, but it is my understanding that the application bundle is read-only. I have read that if you have a pre-populated Core Data store in the app bundle, you need to copy it to the Documents directory - and then make modifications that copy.

Check out this.

Community
  • 1
  • 1
westsider
  • 4,967
  • 5
  • 36
  • 51