AppDelegate * appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [self getContext];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Category_List" inManagedObjectContext:context];
[request setEntity:entity];
NSError *error1 = nil;
NSArray *results1 = [context executeFetchRequest:request error:&error1];
NSLog(@"Fetch Request Data Count = %lu", (unsigned long)[results1 count]);
答案 0 :(得分:0)
我只是调用上下文的重置方法,我的问题就解决了。
[context reset];