I have several UITableViewControllers and want all of them to have several properties, such as fetchedResultsController and managedObjectContext. Therefore, I made an abstract class for all of them, to add these common properties once, as well as to execute some protocols (for example, others that I come across) and change / add code for all these similar TVCs. I defined a property called fetchedResultsController in the title of this abstract class:
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
In each subclass of my abstract class, I want to create a custom getter for this property, to lazily create an instance of fetchedResultsController and initialize a select request, etc. I found that I need to add:
@synthesize fetchedResultsController = _fetchedResultsController;
Each subclass must have iVar to create a recipient.
My question is:
Why can't I see iVars properties in each of my subclasses of my abstract class?
Or in other words:
Is there a way to make custom accessor methods for a property defined in a superclass without the need for @synthesize iVar?
source
share