• 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: NSButtonCell visibility binding in NSOutlineView [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonCell visibility binding in NSOutlineView [SOLVED]


  • Subject: Re: NSButtonCell visibility binding in NSOutlineView [SOLVED]
  • From: Corbin Dunn <email@hidden>
  • Date: Wed, 29 Apr 2009 10:47:35 -0700


On Apr 29, 2009, at 9:31 AM, Chris Tracewell wrote:

Kyle,

Thanks for the reply. Yes I know and agree on the issue of the usability. I struggled with this but ultimately felt it was essential as other options disassociated the property from the object too much or made it appear that a given object could indeed have the property enabled.

What I made work, and feels like the best solution is to use was a OV delegate I had missed. It's nice as it requires no custom drawing and allows me to inspect the object. It took one IBOutlet to bind to the column I wanted to modify.

-(NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
if (tableColumn == myAttributeColumn && ![[[[item representedObject] representedObject] myType] isEqualToString:@"style"])
{
return [NSTextFieldCell new];
}

return [tableColumn dataCellForRow:item];
}



This is not a fully correct solution. Your code as-is will leak lots of memory (unless you are creating a GC app, in which case it won't have good performance due to creating too many cells). You probably want to use -willDisplayCell to reset or properly setup your state for the cells.


-corbin




_______________________________________________

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


References: 
 >NSButtonCell visibility binding in NSOutlineView (From: Chris Tracewell <email@hidden>)
 >Re: NSButtonCell visibility binding in NSOutlineView (From: Kyle Sluder <email@hidden>)
 >Re: NSButtonCell visibility binding in NSOutlineView [SOLVED] (From: Chris Tracewell <email@hidden>)

  • Prev by Date: Re: NSButtonCell visibility binding in NSOutlineView
  • Next by Date: NSOperation, Sqlite, library routine called out of sequence
  • Previous by thread: Re: NSButtonCell visibility binding in NSOutlineView [SOLVED]
  • Next by thread: Re: NSButtonCell visibility binding in NSOutlineView
  • Index(es):
    • Date
    • Thread