My question is pretty simple, so I hope I can get an answer soon.
I'm writing an iPhone app and on one of my objects I have a property called "text". In the implementation file I have written a custom setter:
- (void) setText: (NSString*) text
{
_text = text;
self.textField.text = text;
}
This works fine until I try to also implement the getter:
- (NSString*) text
{
return self.textField.text;
}
After I have written this the compiler starts complaining about the first line in the setter:
_text = text;
saying "use of undeclared identifier _text; did you mean "text" ?
No. I did not mean text. I meant _text. What do you mean oh mighty compiler?