Sunday, 15 June 2014

xcode - Core Data Problems? -


I am trying to use CoreData but I already have my project Went through setup and forgot to check the box to use it

There is no way to implement the use of core data when the first core data The box was not checked?

If I start a new project, then I have to move a lot of information and it takes time so I would not like to be on the same project nor would I like to be new.

If you want your existing project setup template to set up you, then the fastest way is to create just a new project as an example and select the Core Data Tick box. Open a new project and review the AppDelegate.m file and press the code to start the core data stack. This is approximately 80 lines and there is a comment calling the Core Data Stack.

Take it to your existing project and put it in your own adelat file. In addition to your existing project, add the Cordata Framework, then add it to a new file (File-> New File-> CoreData), named "Data Model" file under Core Data. This file is used to define the equivalent of your data schema. You choose to use it graphical control.

Then use your sample project to review the way to access the core data stack by reviewing the sample view controller.

Note: Some people are not fond of how Apple sets the core data stack in AppDelegate.m and you will find many comments about it and how to do it better, if you search for it (I It must be forced to disclaimer). GitHub also has some third-party libraries which can help you in this regard. (Magical record, SLCardacetracks, etc.).

Hope that helps! Good!


No comments:

Post a Comment