iPhone app launch times and Core Data migration
Posted
by sehugg
on Stack Overflow
See other posts from Stack Overflow
or by sehugg
Published on 2010-05-18T19:12:59Z
Indexed on
2010/05/18
19:30 UTC
Read the original article
Hit count: 236
I have a Core Data application which I plan to update with a new schema. The lightweight migration seems to work, but it takes time proportional to the amount of data in the database. This occurs in the didFinishLaunchingWithOptions
phase of the app.
I want to avoid <app> failed to launch in time
problems, so I assume I cannot keep the migration in the didFinishLaunchingWithOptions
method.
I assume the best method would involve performing the migration in a background thread. I assume also that I'd need to defer loading of the main ViewController until the loading completes to avoid using the managedObjectContext
until initialization completes.
Does this make sense, and is there example code (maybe in Apple sample projects) of this sort of initialization?
© Stack Overflow or respective owner