Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Apr 11, 2009, 05:39 PM   #1
macrumors 6502
Join Date: Apr 2005
[cell setTransparent] in NSOutlineView

I am using this method to hide the disclosure triangle, in nonexpandable items in an NSOutlineView:

- (void)outlineView:(NSOutlineView *)theOutlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
	if ([item count] == 0)
        [cell setTransparent:YES];
        [cell setTransparent:NO];
it does what i want, but slows the OutlineView down to a crawl. Is there a better way to implement this?
I only want a disclosure triangle shown for expandable items... not every item in my OutlineView.

thanks in advance

<edit>Should mention, I am using NSTreeController for the Datasource</edit>

Last edited by BollywooD; Apr 11, 2009 at 05:54 PM.
BollywooD is offline   0 Reply With Quote
Old Apr 13, 2009, 07:02 AM   #2
Moderator emeritus
kainjow's Avatar
Join Date: Jun 2000
I've never used NSTreeController before, but try implementing an isLeaf method in your object. From the docs:
You can optionally provide a leaf key path that specifies a key in your model object that returns YES if the object is a leaf node, and NO if it is not. Providing this key path prevents the NSTreeController from having to determine if a child object is a leaf node by examining the child object and as a result improve performance.
Edit: if you're targeting 10.5+ with your app, it might help to make your node objects a subclass of NSTreeNode.
kainjow is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
overriding mouseup in NSOutlineView Subclass McBgnr Mac Programming 1 Nov 13, 2009 09:51 AM
Numbers: cell references in cell references PCheese Mac Applications and Mac App Store 3 Oct 13, 2009 09:25 PM
Checkbox in NSOutlineView mahaboob Mac Programming 0 Sep 9, 2008 11:23 PM
cell phones in chicago! greatm31 Buying Tips, Advice and Discussion (archive) 13 Aug 2, 2004 05:52 PM
Suggestions for a New Cell Phone in VA GorillaPaws Buying Tips, Advice and Discussion (archive) 1 May 5, 2004 01:59 PM

All times are GMT -5. The time now is 12:26 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC