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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to