Re: NSOutlineView+NSTreeController+Drag&Drop
Re: NSOutlineView+NSTreeController+Drag&Drop
- Subject: Re: NSOutlineView+NSTreeController+Drag&Drop
- From: Scott Stevenson <email@hidden>
- Date: Tue, 3 May 2005 12:51:37 -0700
On May 3, 2005, at 12:29 PM, Kevin Stone wrote:
but then the outline view will insist that all of the other methods
in that protocol be implemented: "Must implement
outlineView:numberOfChildrenOfItem:, outlineView:isItemExpandable:,
outlineView:child:ofItem: and
outlineView:objectValueForTableColumn:byItem:". When those methods
are made to exist, the NSOutlineView will ignore the data in the
NSTreeController altogether.
Implement them like this:
- (BOOL) outlineView: (NSOutlineView *)ov isItemExpandable: (id)item
{ return NO; }
- (int) outlineView: (NSOutlineView *)ov numberOfChildrenOfItem:(id)
item { return 0; }
- (id) outlineView: (NSOutlineView *)ov child:(int)index ofItem:(id)
item { return nil; }
- (id) outlineView: (NSOutlineView *)ov objectValueForTableColumn:
(NSTableColumn*) col byItem:(id)item { return nil; }
That should leave the NSTreeController in charge.
You'll probably also run into the fact that the "items" are proxy
objects. You might have to use the -observedObject hack from a recent
thread here.
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden