If I have a @property which I didn\'t want to have backed via an ivar I simply omitted the @synthesize and had manual getters which re
If you mark the property as readonly and implement the getter yourself, it seems that iVar will not be created.
Interface declaration:
@property (nonatomic, readonly) BOOL myBoolProp;
Impementation:
- (BOOL)myBoolProp {
return true;
}
Trying this:
- (void)viewDidLoad {
[super viewDidLoad];
_myBoolProp = true;
}
will generate an error: Use of undeclared identifier '_myBoolProp'
Removing the custom getter method also removes the error, appearing to demonstrate that the iVar has now been generated.