• 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
Re: [iPhone] Why can't a UITextField be its own delegate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iPhone] Why can't a UITextField be its own delegate?


  • Subject: Re: [iPhone] Why can't a UITextField be its own delegate?
  • From: WT <email@hidden>
  • Date: Sun, 26 Jul 2009 01:18:18 +0200

On Jul 26, 2009, at 1:04 AM, WT wrote:

Now, I agree that UITextField will run into an infinite loop (in the sample app) when calling -respondsToSelector on its delegate because it is its own delegate. However, why is it then that - textFieldShouldBeginEditing returns successfully and - textFieldDidBeginEditing executes but doesn't return? Both of them successfully print their method names:

- (BOOL) textFieldShouldBeginEditing: (UITextField*) text_field
{
   NSLog(@"-textFieldShouldBeginEditing:");
   return YES;
}

- (void) textFieldDidBeginEditing: (UITextField*) text_field
{
   NSLog(@"-textFieldDidBeginEditing:");
}

It would seem that -respondsToSelector: is not being called at all.

Actually, it is and I do get an infinite loop, thanks to

- (BOOL) respondsToSelector: (SEL) selector
{
    NSLog(@"-respondsToSelector:");
    return [super respondsToSelector: selector];
}

How do I get a string for the name of the method represented by the selector?

Wagner
_______________________________________________

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: [iPhone] Why can't a UITextField be its own delegate?
      • From: WT <email@hidden>
References: 
 >[iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: Brian Slick <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: Luke the Hiesterman <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: Kyle Sluder <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: Kyle Sluder <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: Kyle Sluder <email@hidden>)
 >Re: [iPhone] Why can't a UITextField be its own delegate? (From: WT <email@hidden>)

  • Prev by Date: Re: I need a milder application badge (solution)
  • Next by Date: Re: I need a milder application badge (solution)
  • Previous by thread: Re: [iPhone] Why can't a UITextField be its own delegate?
  • Next by thread: Re: [iPhone] Why can't a UITextField be its own delegate?
  • Index(es):
    • Date
    • Thread