0

I am using the SQLite Manager extension to Firefox to prefill my core data sqlite database.

But when i try adding more to the prefilled database my app crashes. I suspect it has something to do with Z_MAX for my entity in the table Z_PRIMARYKEY.

What should i set Z_MAX to? Is it supposed to be the number of items in my entity?

So if i add 1000 entries in the table Z_MYENTITY then i have to set Z_MAX to the correspoding entity in Z_PRIMARYKEY to 1000?

LarsJK
  • 2,196
  • 18
  • 23

1 Answers1

3

I highly recommend not trying to replicate the internal structure of a Core Data database. It is undocumented and not guaranteed by Apple to remain the same over time (even though it has been relatively stable).

Instead, I suggest creating a simple Mac client to prepopulate your database. This is a very easy thing to do, as I described in this answer. I also show how to do this in the video for the Core Data session of my iPhone class on iTunes U.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • Thanks I'l whatch those iTunes U videos! Seems useful! If changing the Z_MAX is not an option, I think I'l implement a method to parse my csv and add to the entity.. But I'l check you're method out first.. – LarsJK Jul 08 '10 at 12:59
  • @Larsaronen - If you watch the video, you'll see me create a Mac client in under 15 minutes to do data entry for an iPhone Core Data application. I'll think you'll find that a lot easier than spending hours to reverse engineer the database format. – Brad Larson Jul 08 '10 at 15:58
  • I had a huge database in a spreadsheet, so a saving it as a csv and parsing that was easy and fast enough.. But thanx for pointing me to you're iTunes U videos. I'm sure they will be a great resource. – LarsJK Jul 08 '10 at 16:47