I have a private BOOL in a class
@property (nonatomic, assign) BOOL myBool;
I want to override the getter and setter so I can either synchronize it, or dispatch it to a serial queue.
- (BOOL)myBool
{
__block BOOL test = NO;
dispatch_sync(self.shouldShowBannerQueue, ^{
test = _myBool; //This does not work. I get an error "Use of undeclared _myBool"
});
return test;
}
I cannot override the setter for the same reason. I cannot directly access _myBool.