What are some advantages of using Core Data? (as opposed to plist)

后端 未结 2 1497
隐瞒了意图╮
隐瞒了意图╮ 2021-01-01 14:11

I am relatively new to iOS and programming, and I made an app before, but it used a plist for storage, which I saved to the documents folder. Now, I am thinking about switch

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-01 14:14

    It's a matter of what you're saving. For simple strings, arrays, dictionaries, it's fine to use a plist. For something more complicated (data, images, non-object information) or something with to-many relationships (think relationship between song to album, or photo to photographer), then something like a more robust solution might work better like SQLite.

    CoreData is an objective-c-based wrapper around SQLite. If you think you might want to something more complicated, CoreData might be the way to go.

    If you need a quick tutorial, I'd check out: http://www.raywenderlich.com/934/core-data-tutorial-getting-started

    This got me going and allowed me to learn the basics the workings of CoreData.

    Good luck!

提交回复
热议问题