You might want to declare _infoImageView
as a protected variable in the header file alongside with the property.
Another idea is to create a public defaultImageView
method to call inside the lazy getter.
Something like this:
@interface MyGenericClass : UIViewController
@property (nonatomic, readonly) UIImageView *infoImageView
...
@implementation GenericClass
- (UIImageView *)infoImageView
{
if (!_infoImageView) {
_infoImageView = [self defaultImageView];
}
return _infoImageView;
}
- (UIImageView *)defaultImageView
{
return [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PlaceholderInfoImage"]];
}
...
@interface MySpecificSubclass : MyGenericClass
...
@implementation MySpecificSubclass
- (UIImageView *)defaultImageView
{
return [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SpecialInfoImage"]];
}