The ivars are private to the class that defines the property (and synthesizes the ivar). Subclasses don't have access to private ivars of their parent classes. That's a good thing.
Why don't you so something like this in your subclass (instead of having each subclass call @synthesize
):
Subclass.m
- (NSFetchedResultsController *)fetchedResultsController {
NSFetchedResultsController *result = [super fetchedResultsController];
if (!result) {
result = ... // lazy load your controller
[super setFetchedResultsController:result];
}
return result;
}
Now there is no need for the subclass to access the private ivar of the parent class.
If your subclass also overrides the setter, you may want to call self
instead of super
on the call to setFetchedResultsController:
.