开发者

Universal iPhone/iPad appDelegates

开发者 https://www.devze.com 2023-01-09 13:09 出处:网络
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 subclass

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
0

精彩评论

暂无评论...
验证码 换一张
取 消