Re: dataCellForTableColumn method
Re: dataCellForTableColumn method
- Subject: Re: dataCellForTableColumn method
- From: Hans Hansen <email@hidden>
- Date: Thu, 20 Mar 2008 09:33:41 -0700
Well I found a work around using preparedCellAtColumn:row: and then
calling selectWithFrame directly...
...but there has got to be a better way! :D
On Mar 19, 2008, at 2:58 PM, Hans Hansen wrote:
Anyone know how best to use multiple NSTextCell subclasses, in a
table/outline column?
When I use the dataCell... methods in NSTableColumn, NSTableView, or
NSOutlineView, it works great until I try to edit the cell, at which
point the cells never receive the edit/select actions. I've tried
lots of things but can't figure out what's happening, nor a better
why to do this overall.
In other words:
When I use the dataCellForTableColumn method, my table does display
the different textcell subclasses returned. But when I send the
table/outline [self editColumn:1 row:[self selectedRow]
withEvent:theEvent select:YES] message it seems to get lost -- my
specified cells don't receive an editWithFrame/selectWithFrame
action. If I remove this method and only use one cell class in the
column, it works as expected.
- (NSCell *)outlineView:(NSOutlineView *)outlineView
dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
if ([item isKindOfClass:[Project class]]) return projectTextCell;
if ([item isKindOfClass:[Action class]]) return actionTextCell;
if ([item isKindOfClass:[Item class]]) return itemTextCell;
if ([item isKindOfClass:[Note class]]) return noteTextCell;
return nil;
}
The point of this is to breakout my cell designs for efficiency and
comprehension. But so far it's just making me nuts. ;-).
_______________________________________________
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