0

I planned to make an iPhone app which store to-do lists like thing. What is the best approach to store data in an iPhone in such situation, SQLite or core-data.

Susitha
  • 3,339
  • 5
  • 27
  • 41

2 Answers2

1

One thing to note here is that because Core Data utilizes SQLite in its storage layer, there is still a standard SQLite system library available for use.

Core Data has some significant advantages. Apple provides development tools that allow a developer to quickly lay out their data requirements and relationships. This can reduce development time and save on code. The Core Data package is also well integrated into current Mac OS X systems, allowing data to move back and forth between the platforms quite easily.

I personally prefer to use Core data in my application as it takes care of the integrity and consistency of objects and relationships. If you are new to Core data this tutorial may help you get a basic understanding of the way it works. http://www.raywenderlich.com/934/core-data-tutorial-getting-started

For all the advantages that Core Data provides, there are still situations where it makes sense to use SQLite directly. The most obvious consideration is if your development needs extend beyond Apple platforms. Unlike Core Data, the SQLite library is available on nearly any platform, allowing data files to be moved and accessed almost anywhere on any platform. Core Data also uses a different storage and retrieval model than SQLite. If your application is particularly well suited to the Relational Model, there may be advantages to having direct SQL query access to the data storage layer.

Narayanan
  • 785
  • 2
  • 6
  • 5
-2

SQLLite should be used for this type of data, since at some point you may want to be able to query against it (ie, show me all todos on march 27th). I think of Core-data as being intended for initialization type settings (user preferences).

javram
  • 2,635
  • 1
  • 13
  • 18
  • 3
    NSUserDefaults is intended for Settings. Core Data has basically the same use cases as SQLite. Actually Core Data uses SQLite as backend storage and gives the additional value of beeing able to use a model designer for your entities. – Andy Friese Mar 28 '12 at 05:32