Re: NSTableView delegate not getting called
Re: NSTableView delegate not getting called
- Subject: Re: NSTableView delegate not getting called
- From: Shawn Erickson <email@hidden>
- Date: Tue, 13 Jul 2004 11:15:10 -0700
On Jul 13, 2004, at 10:46 AM, David Alter wrote:
On Jul 12, 2004, at 3:32 PM, Chuck Soper wrote:
NSOutlineView delegate methods are not subclassed from NSTableView.
This is why
NSTableView delegate methods are not called in your NSOutlineView
delegate.
Chuck
That does not make sense. Why would they do that? What ever the case.
I have done it manually. First I checked to see what the delegate is
by calling [NSTableView delegate]. The delegate appears to be correct,
but I'm going to set it anyway. Then I used the setDelegate method
from NSTableView to set the delegate to the same delegate that I'm
using for the NSOutlineView. My NSTableView delegate methods still
does not get called.
Why would you want the delegate methods specific to the functioning of
table view to exist along with those specific to an outline view when
using a outline view for example? The NSOutlineView has it own expected
delegate methods that it will call of a data source while a NSTableView
has a different set. The delegate methods are not part of the class but
defined to be used by the class... so they are not inherited nor should
they.
If you want one data source object to exist and be used by both types
of views simply implement both sets of delegate methods as needed in
your data source object and hook up the delegate object as needed.
This is one reason why delegates exist... to allow you to keep your
model separate so you can have multiple views of it. The delegate
method define a data access interface for the views types and you can
do whatever you want behind them.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.