I have a situation where my subclass is not seeing the superclass' instance variable x
. The ivar is obviously @protected
by default, so why do I get a compiler error "x undeclared"?
- (CGSize)hitSize
{
// Compiler error
return size;
}
EDIT: hitSize is a property of a protocol my subclass is conforming to. The problem was that I had hitSize @synthesize
d, which was the culprit. The question then is why can't the synthesized getter see the ivar?
EDIT: Now that I found out the problem, I edited the question to ask why this is an error.