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