title: Where is the proper place to initialize data in a core data store?
body: <p>For an iPhone app that has to have a bunch of data inserted before the user can do their thing on first launch, where is the correct place (in the code) to insert that data? I'm looking at between 700 - 800 records total between a few tables.</p>
  <p>I initially tried doing it in <code>applicationDidFinishLaunching:</code>.  This worked fine for the iPhone 3gs, but caused a consistent first-launch crash on the 3g.  After digging into the problem, i found that on the 3g, the app wasn't responding fast enough (presumably because it was busy dumping loads of data into the persistent store), so the OS was killing it under the assumption it was unresponsive.</p>
  <p>To fix this problem, I moved the data initialization process out of appdidfinishlaunching and spawned another thread from the first view controller that shows upon launch.  This works most of the time, but every once in a while the app crashes with a 134030 error in core data, which according to the apple constants reference, is:</p>
  <blockquote>
  <p>NSPersistentStoreSaveError</p>
  <p>Error code to denote that a persistent store returned an error for a save operation. This code pertains to errors such as permissions problems.</p>
  </blockquote>
  <p>This error pops up when calling <code>save:</code> on the managedObjectContext.</p>