Typical applications use XCcode’s model editor to define entities and their properties.
Suppose, I’d like to create an application, which needs more flexibility. The app needs to create fresh new entity-types with arbitrary attributes.
May a Cocoa application create new entity-tpes at run-time?
You can do this by creating or copying and modifying an NSManagedObjectModel, the documentation for this class is a good place to start. There are some caveats, though, you can’t just modify it on the fly as it invalidates your persistent store – so you’d have to do a migration to a new persistent store based on your new model.