views:

140

answers:

2

I've been using Core Data for about a week now, and really loving it, but one minor issue is that setting default values requires going through and setting up a temp interface to load the data, which I then do away with once I have the data seeded. Is there any way to edit values in a table, like how you can use phpMyAdmin to manipulate values in a MySQL database? Alternately, is there a way to write a function to import seed values from something like a Numbers spreadsheet if it doesn't detect the storedata XML file?

+2  A: 

For your first question, you could edit the file directly but it's highly recommended you don't. How to edit it depends entirely on the store type you selected.

Regarding importing or setting up pre-generated data, of course: you can write code to manually insert entity instances into your Managed Object Context. There's a dedicated section on this very topic in the documentation. Further, if you have a lot of data to import, there's even a section on how to do this efficiently.

Joshua Nozzi
+2  A: 

Is there any way to edit values in a table, like how you can use phpMyAdmin to manipulate values in a MySQL database?

Xcode has a means of creating a quick and dirty interface for a data model. You just drag the data model file into a window in interface builder and it autogenerates an interface for you. This lets you view the data without having to have your entire app up and running.

TechZen
The OP mentioned, more or less, that this was what he was doing. His question appears to be "how to do this automatically, without the temporary interface".
Joshua Nozzi
Upon another reading I think you're right that the OP already knew this.
TechZen
Didn't know about this one, actually. That's pretty neat! Thanks to both of you for helping with this.
Kaji

related questions