ios - Restkit 2.0 'managedObjectContext' not found on object of type -
The excuse of possible noob question I am creating an app with Restkit 2.0 and problems in implementing core data features I am coming later I added the following code to my AppViewController (all other view controllers extend this class). I am getting the error: What can I do to fix this problem? You might see this code in Your error: Property managed object contact not found Type of 'Option Visual Controller' seems unrelated to the restructuring is. This means that you are using - (zero) viewDidoadload {[Super Viewedload]; Self.navigationController.navigationBar.shadowImage = [UIImage new]; NSError * Error = Zero; NSURL * modelURL = [path with NSUr file URL: [[NSBundle main bundle] Pathfoser resource: @ Type of "Jumplits": @ "wax"]]; // Note: Due to an iOS 5 bug, the returned object model is irreversible NSManagedObjectModel * Managed objectModel = [[[NSManed ObjectModel Alok] initWithContentsOfURL: modelURL] mutableCopy]; RKManagedObjectStore * Managed Obsoststore = [[RKManage ObjectStore Alok] initWithManagedObjectModel: managedObjectModel]; // Start Core Data Stack [Make Managed ObjectStoreSecantstore Coordinator]; NSPersistentStore __unused * persistentStore = [Managed ObjectStore addInMemoryPersistentStore: & amp; Error]; NSAssert (Continuous store, @ "Failed to add constant store:% @", error); [Create Managed Objects StoreManage Object Contexus]; // Set default store share example [RKManagedObjectStore setDefaultStore: managedObjectStore]; // Override Point for optimization after application launch. Self.managedObjectContext = managedObjectStore.mainQueueManagedObjectContext; }
property managed object not found on the object of 'contact' option 'AppViewController'
viewDidLoad in your superclass because it means that Because this is being run for each subclass, every VC will have its own Core Data Stack. It is more likely that you want a single core data stack which is used by all controllers (possibly in a singleton data controller).
self.managedObjectContext , when you do not have a property named
managedObjectContext you need to add property so that it can be referenced .
Comments
Post a Comment