• 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: Kyle Sluder <email@hidden>
  • Date: Sat, 25 Jul 2009 15:55:42 -0700

On Jul 25, 2009, at 3:41 PM, "Adam R. Maxwell" <email@hidden> wrote:

Where is this guaranteed by the delegate pattern? I've created a fair number of classes with delegates and never done this; it would be interesting to know that I've been doing it wrong for years ;).

You seem to be right; I can't find this in the documentation. Must be confusing it with another pattern.


But the critical point is that if the object ever invokes - respondsToSelector: on self.delegate it will infinitely recurse. This is a very common pattern. One could override -respondsToSelector: to fix this issue, but then it would have to do some trickery to ensure it skips super's implementation. And that's just for this one known case.

--Kyle Sluder

_______________________________________________

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


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: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: Multiple delegates Window
  • Next by Date: Re: Unit testing question
  • 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