• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting a delegate on a UITextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Setting a delegate on a UITextField
      • From: Phillip Mills <email@hidden>
  • Prev by Date: NSButton disappears when I turn on "Wants Core Animation Layer" in IB
  • Next by Date: Re: Setting a delegate on a UITextField
  • Previous by thread: Re: NSButton disappears when I turn on "Wants Core Animation Layer" in IB
  • Next by thread: Re: Setting a delegate on a UITextField
  • Index(es):
    • Date
    • Thread