I'm new to iOS development, currently following along with Lynda's tutorial by Simon Allardice on iOS SDK Essential Training, the chapter on "Creating quick connections."
I'm getting this error message on build:
"Use of undeclared identifier 'myTextfield'; Did you mean '_myTextfield'?"
The error message implicates this line of code:
- (IBAction)changeLabel:(id)sender
{
NSString *message = [[NSString alloc] initWithFormat:@"Hello %@", myTextfield.text];
}
The variable "myTextfield" (spelt correctly, and sans underscore) is clearly declared in the associated header file:
@property (weak, nonatomic) IBOutlet UITextField *myTextfield;
I'm confounded by the suggestion that I place an underscore in front of the var name. Nevertheless, if I follow this recommendation, the code compiles.
I'm using Xcode 4.6.3 with Lion on a MacBook Pro.
Can someone please suggest a solution to this mystery?