I have a Tab Bar based application and am trying to integrate Core Data into it. I created a navigation based application set up with core data, with the same name as my tab bar application, and copied the App Delegate from there to my tab bar application. I then added a method to retrieve data from my database. When I build and run, xcode gives me an error saying that my persistent store coordinator is nil. However, when I build and run the navigation based app, it gives me an error saying that a fetch request must have an entity. Here is the code I'm using to retrieve data, I'm guessing there's something wrong with it:
Code:
-(void)getData {
NSManagedObjectContext *context = [self managedObjectContext];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"History" inManagedObjectContext:context];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity:entity];
NSError *error = nil;
NSArray *history = nil;
history = [context executeFetchRequest:request error:&error];
}