views:

37

answers:

1

Hi!

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?

+1  A: 

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.

Brad Larson
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..
Larsaronen
@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
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.
Larsaronen