Search code examples
iphoneioscore-datauimanageddocument

UIManagedDocument and Core Data


I have found these Stanford tutorials https://itunes.apple.com/us/course/ipad-iphone-app-development/id495052415, and have been listening a lecture about core data, which is really great.

It shows how to access Core Data via UIManagedDocument... Only thing I don't understand how UIManagedDocument knows which model should it use, because I don't see it set anywhere?

To sum it when using UIManagedDocument, how do you define database model that is gonna be used?


Solution

  • I found the answer:

    'UIManagedDocument' takes all the models from your application's main bundle, and makes union of these models. If you only have one model that model is used.

    This can be changed by overriding 'UIManagedDocument' class.