MatterGoal
MatterGoal

Reputation: 16430

CoreData and pre-filled DB

I need to prepare my IOS application with a Pre-filled DB. I'm wondering whether my technique is good of if it leaks in something:

  1. At the first App launch: Call a function that fill data in DB, only if field "DB_filled" in property list is equal to "NO".
  2. When function completes and data is stored in DB: setup plist with "DB_filled" => YES.
  3. At the next App launch: DB_filled is equal to YES, thus, no other attempts to pre fill Db are done.

I'm not sure this's the correct technique. What do you think?

Upvotes: 1

Views: 422

Answers (1)

Eimantas
Eimantas

Reputation: 49354

This is most common scenario for first-launch app setup except for variances in key name (firstLaunch, FirstLaunch or SetupDone, or, in your case, DB_filled). Check this question too.

Upvotes: 2

Related Questions