Is it possible at runtime to generate a core data model from a set of entities on a server? e.g. SharePoint lists or SQL/MySQL/Parse.
I'm trying to go a dynamic route because fields in SharePoint lists/SQL/Parse may be added at any time in the future meaning the core data model version in the app has to change to match the SharePoint list on the server. If it was possible to generate an entity (SharePoint list) in core data dynamically then the app won't break when the columns in the entity change on the server.
If this is possible does anybody have an example?
See the reference for NSEntityDescription. You can build up a model definition by defining entities in code.
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CoreDataFramework/Classes/NSEntityDescription_Class/NSEntityDescription.html
Edit
From our good friends at Cocoanetics: http://www.cocoanetics.com/2012/04/creating-a-coredata-model-in-code/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With