How to enable “Use Core Data” on existing project?

2019-09-21 00:15发布

问题:

This question already has an answer here:

  • Adding Core Data to existing iPhone project 13 answers

Before creating my project, I wasn't sure if I was going to use Core Data. I figured it'd be something I can easily toggle on/off later. I'm starting to regret my decision of not deciding immediately.

Is there any way I can turn it on? Or do I have to create an entirely separate project just to enable it?

回答1:

Click File Menu -> New File ..........



回答2:

Got to XCode menu and click File -> New -> File. Then scroll down to Core Data and add Data Model. From there I'm afraid you are going to have to study up on how to add, edit, and delete data from that Data Model.

They don't like us adding links to answers because they can go stale after a while. I suggest you go to the raywenderlich.com website and search on Core Data. There are several good tutorials there that will get you started.



标签: ios xcode