开发者

CoreData and pre-filled DB

开发者 https://www.devze.com 2023-02-22 09:30 出处:网络
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:

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 comple开发者_Go百科tes 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消