Core Data VS Sqlite or FMDB…?

后端 未结 6 648
广开言路
广开言路 2020-12-07 10:40

Now this might look like a duplicate thread, but my question is that I have read a lot of questions like.. Core Data vs SQLite 3 and others but these are 2-3 years old. I ha

6条回答
  •  有刺的猬
    2020-12-07 11:00

    As a new SQL guy, I'm going to throw in my two cents:

    In Core Data, you have a bit of "boilerplate" code that you need to put in before you can actually use your database. Your app needs at least one of these:

    1. A persistent store coordinator
    2. A managed object context
    3. A managed object. This correlates to an entity, which correlates to a table if you use an SQLite database.

    To take full advantage of the framework, you need to understand what role these objects play in the management of your data.

    On the other hand, we have SQLite, which - in my opinion - is much easier to understand. To start, you'll need:

    1. A database
    2. A table or more (depending on your data)
    3. Knowledge of SQL - a flexible language with a simplistic syntax (SELECT queries do more than what you might originally think they do)
    4. An object through which your app communicates with SQLite.

提交回复
热议问题