I created a non core data project. I now want to use core data. In the build phases, I linked my binary with CoreData.framework. In my application delegate method, I want to manually create a managed object context like so
NSManagedObjectContext *aContext = [[NSManagedObjectContext alloc] init];
When I do the above, I get the following error,
Receiver 'NSManagedObjectContext' for class message is a forward declaration.
Any suggestions on what I might be doing wrong?
You need to import CoreData/CoreData.h in your application delegate’s header file:
Since you probably use it through outyour application you should put it in the precompiled header file, YourApp-Prefix.pch: