Hey man, I shared your frustration with this chapter for sure. I think it makes it all that much harder when most of this book explains everything so well and makes it “easy” for you to learn, then this chapter doesn’t make things as obvious. The upside to this is that I think it is good to have to struggle to learn at times so you can develop that discipline for the future when you won’t have people teaching you these concepts and you’ll really be on your own. That said, I hope you’ve been sticking with it and have figured some of the Core Data stuff out. I’m still learning but after I read this chapter I went searching for other resources and feel like I’ve gotten some understanding of it.
With the model, my understanding is that it is basically a mechanism by which to instantiate the persistent store coordinator, so that you can interact with the persistent store, and I think that it’s also basically putting your graphic data modeller into code, and it kinda talks with those managed object contexts that interact with the persistent store coordinator. (Side note: I read somewhere that it’s helpful to think of contexts as desktop word documents. You can add and edit things in text editor and save them to a file when you want. So the context/text editor is separate from the persistent store/file where you save the contexts objects/document.)
// Read in Homepwner.xdatamodeld
model = [NSManagedObjectModel mergedModelFromBundles:nil];
The comment above “model’s” instantiation is what makes me think its a code representation of the graphic editor. Also if you alt + click the “NSManagedObjectModel” class declaration and go to the NSManagedObjectModel Class Reference, it gives you some info on what models do. It seems important to understand that entities and managed objects are not exactly the same thing, though they correspond closely. So the model helps to relate entities to managed objects which reside in managed object contexts, which are saved in persistent stores.
I know that probably wasn’t the best description and I might be off on some that but hopefully others will correct me where I’m wrong. Hope that helps you or someone else in some way.