I've declared the property:
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
and then I use it like this: statusLabel.text = plainText; or [statusLabel setText plainText];
In both cases I get compiler error "Use of undeclared identifier 'statusLabel'; did you mean _statusLabel?"". Actually, when I replace statusLabel with _statusLabel, compiler is happy.
I'm completely puzzled. 1. Yes, XCode automatically synthesizes _statusLabel, but I'm trying to use property, not an instance variable. Why property is not visible?
Using .(dot) with ivar is wrong as I understand, dot is for properties. Why again?
If I manually specify to synthesize a var without underscore, the code works, but again, it means compiler works with variable and not with property.
So, this combination works: @synthesize statusLabel = statusLabel; ... [statusLabel setText: plainText];
and this not: @synthesize statusLabel = _statusLabel; ... [statusLabel setText: plainText];
Anybody to explain? Thanks a lot. Serge