Wow, this all sounds very convoluted. If you must have two levels of delegation (which sounds like flawed design, to me) then I would suggest doing it in a more straightforward manner. That is, make a delegate for UITextField, and then have another delegate protocol for that object so it can have its own delegate. Even better, just wrap everything you need into the object you set as delegate to UITextField and don't try to shove weird things into a subclass.

Luke

On Jul 25, 2009, at 12:39 PM, WT wrote:

The reason is simple, though probably not obvious.

I still might need the text field to have an "outside" delegate, which I maintain by having an additional outlet reserved for that delegate. Then, I override -delegate to return that outlet and - setDelegate: to set it.

That way, the field can be its own true delegate and do its job, while also allowing an outside object to serve as a delegate and participate in the editing session. As far as the outside world is concerned, it's business as usual.

But once I have an overridden -setDelegate:, I can't use self.delegate = self to set the field as its own true delegate, because that will execute the overridden method.

Wagner
_______________________

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to