This time I get weird behavior with NSFetchedResultsController. I create fetchRequest as follows:
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entdesc = [NSEntityDescription entityForName:@"Exam" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entdesc];
NSPredicate *predi = [NSPredicate predicateWithFormat:@"student == %@", self.student];
[fetchRequest setPredicate:predi];
If I execute it using executeFetchRequest:error:NSManagedObjectContext, I get the expected result. All student exams. (One-to-many relationship between student and exam) But if I use the same fetchRequest in NSFetchedResultsController, I get something else. So far I have not got out, which I understood for sure. In my eyes, the result is random.
Could you help me? I want to manage this studentโs exams using NSFetchedResultsController.
Sandro Meyer
source
share