Setting a delegate on a UITextField
Setting a delegate on a UITextField
- Subject: Setting a delegate on a UITextField
- From: Jon Sigman <email@hidden>
- Date: Thu, 03 Mar 2011 14:01:45 -0800 (PST)
I'm trying to set up a delegate on a UITextField so I can know when the user has
finished editing.
My delegate is my main view controller:
@interface MainViewController : UIViewController <UITextFieldDelegate>
{
. . .
}
and in the implementation file I have:
- (void) textFieldDidEndEditing:(UITextField)textField
{
// do stuff
}
I set the delegate on the textfield like this:
nameTextField.delegate = (id <UITextFieldDelegate>)mainViewController;
It all builds but at runtime my delegate method never gets called.
What am I overlooking?
iOS 4.2
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden