When creating a new project (universal iPhone/iPad) using Core Da开发者_运维知识库ta, there's the usual appDelegate which creates the ManagedObject Model/Context etc., then there are the two subclasses of the appDelegate (one for each device). I can't seem to call the moc from the subclasses (using [super managedObjectContext]). Could someone enlighten me as to what I'm doing wrong? Something to do with initializing the common appDelegate perhaps? Billy
You should be able to use the managedObjectContext, managedObjectModel, and persistentStoreCoordinator instances from the subclasses if you access them as properties (since the property definitions are exposed in the superclass’ header):
self.managedObjectContext;
self.managedObjectModel
self.persistentStoreCoordinator
精彩评论