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). - (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; }

I am getting the error:

  property managed object not found on the object of 'contact' option 'AppViewController'   

What can I do to fix this problem?

You might see this code in 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).

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 self.managedObjectContext , when you do not have a property named managedObjectContext you need to add property so that it can be referenced .

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -