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: Greg Guerin <email@hidden>
- Date: Sat, 25 Jul 2009 19:16:23 -0700
WT wrote:
It seems I'll have to opt for having a regular UITextField and a
custom class whose sole purpose is to provide a delegate that does
the common work. As Kyle suggested, I may need to make that a
superclass and derive additional delegates to perform extra work
after the common task.
As previously noted, you could also give the common-task delegate its
own delegate. Then you get the advantages of delegation, it's just
one level away from the UITextField's direct delegate.
More generally, you could implement the Chain Of Responsibility
pattern in the UITextField's direct delegate (the principal
delegate), so any number of other secondary delegates could
contribute to the overall task, in chain-priority order, and
according to which selectors a secondary delegate implements. Since
any secondary delegate could also be the principal of its own chain,
you have the potential for a tree of delegates.
-- GG
_______________________________________________
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