How to Add Core Data to an existing Utility Application

后端 未结 3 1498
清歌不尽
清歌不尽 2020-12-13 16:55

I´ve created an utility Application which is nearly complete, but now I´m on a point were I really have to persist Data.

Since XCode provides only Core Data Template

3条回答
  •  悲哀的现实
    2020-12-13 17:35

    Create a new project in XCode, using the templates provided - find one that has a box to check for using Core Data for storage.

    That gives you an xcdatamodel file, and some code/class variables in the application delegate that you can copy from that project into your current one.

    I also highly recommend the Apple tutorial mentioned by nall.

    If you do decide to just use SQLLite directly instead, strongly consider using FMDB, which simplifies SQL code. It's one file you add to a project.

提交回复
热议问题