0

I want to know what the normal/preferred way of working is.

The iOS app needs data. This can come from an included sqlite db, or via an online json feed. What is the normal way of working? Use the sqlite db and update that based on json feed? Or skip the db, only use json?

2
  • If you want to persist the data you should use Core Data. You can either ship a pre-filled database with your app or initialize it from a local or remote JSON file at the first start. If you don't need persistence you typically load some JSON contents into NSDictionaries and NSArrays.
    – HAS
    Mar 18, 2014 at 15:31
  • Someone removed the Xcode tag (that is correct, this question is not related to Xcode at all) but you should add an Objective-C tag.
    – HAS
    Mar 18, 2014 at 15:33

1 Answer 1

1

This really depends on a few things.

  • If your data is going to be static (read-only) you probably will want to use json.
  • If you only have a small amount of data, you may want to look into NSUserDefaults
  • If your data is going to be changing quite a bit, then you may want to look into either SQLite (maybe have a look at FMDB) or CoreData (and I would suggest looking at MagicalRecord).
1
  • For the moment i'm using SQLite with FMDB. Data would be product catalog, so that needs to be updated. So the preferred way is update db from json in the application load? Do you store a version number in the db to check of there is an update? OR, place a new sqlite db online somewhere, and replace the current db in documents folder with the new one?
    – TomVD
    Mar 19, 2014 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.