Re: Custom Delegate - Using _delegate works but not delegate or [self delegate]
Re: Custom Delegate - Using _delegate works but not delegate or [self delegate]
- Subject: Re: Custom Delegate - Using _delegate works but not delegate or [self delegate]
- From: Chris Tracewell <email@hidden>
- Date: Tue, 26 Mar 2013 13:24:14 -0700
On Mar 26, 2013, at 1:11 PM, Conrad Shultz <email@hidden> wrote:
> If code expecting an NSOutlineView receives a TKOutlineView instance it may break or behave unexpectedly since it may well try to set a delegate conforming to <NSOutlineViewDelegate> but you have made your class require a delegate conforming to the more specific <TKOutlineViewDelegate>.
>
> This is why I earlier suggested declaring a -customDelegate (or whatever you'd like to call it) property that would not interfere with the expected delegate behavior.
>
> -Conrad
I think I understand, but have I really required such code to conform to TKOutlineViewDelegate? Wouldn't it be in error to hand code expecting NSOutlineView a TKOutlineView? It seems that since TKOutlineView is a subclass of NSOutlineView that only code that handles TKOutlineView objects will gain these new delegate methods. In addition, those methods do check to make sure the delegate implements the method before I actually send to it.
I'm obviously not fully clear on this topic so thanks in advance for any input.
CT
_______________________________________________
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