Chapter 5 Example Won't Compile
I running the latest Xcode on Lion. The example code in Chapter 5 won't compile as is. When I make what appear to be appropriate corrections, it compiles but crashes.
On page 141 in fetchedResultsController I changed inManagedObjectContext:managedObjectContext to inManagedObjectContext:self.managedObjectContext
On page 142 in tableView... I changed NSManagedObject *managedOject = [fetchedResultsConroller objectAtIndexPath:indexPath]; to NSManagedObject *managedOject = [self.fetchedResultsConroller objectAtIndexPath:indexPath];
I also tried __fetchedResultsConroller, which is what Xcode suggested.
Once I got it to compile, it dies with "executeFetchRequest:error: A fetch request must have an entity".
I put a break point on [fetchRequest setEntity:entity]; on page 141. At that point entity is a zero pointer. I'm guessing the initialization of the pointer in the previous line didn't work. That's where I changed managedObjectContext to self.managedObjectContext
I also checked the online code to find it is the same. At least the problem let's me practice my debugging skills.
Curt
|