• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView+NSTreeController+Drag&Drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >NSOutlineView+NSTreeController+Drag&Drop (From: Kevin Stone <email@hidden>)

  • Prev by Date: Re: ditto in ObjC or C
  • Next by Date: Re: CoreData: Data freshness vs. multithreading
  • Previous by thread: NSOutlineView+NSTreeController+Drag&Drop
  • Next by thread: Carbon menu with Cocoa?
  • Index(es):
    • Date
    • Thread