I am building an iPhone application which pulls a lot of information from an webservices that sends XML.
The problem now is that I am going to import a set of data that needs to import in 4 or 5 related tables.
It depends if the city exists in Core data.
The database looks like this: City – Club – track
The way how I would do it now is to put all the data in the database for each model.
So I would loop 4 or 5 times the data an put this in the database.
But in my head I think there has to be a better way.
One basic document is this Apple CoreData doc called “Efficiently importing data”.
I am also building an app like yours (although on a Mac), and had implemented a very stupid importing routine which was very slow.
Following the recommendation in that document made a huge difference and made importing much, much faster!
Pay your attention in particular to the last section, “Implementing Find-or-Create Efficiently”.