Re: Setting data cell type for a specific row
Re: Setting data cell type for a specific row
- Subject: Re: Setting data cell type for a specific row
- From: Ken Tozier <email@hidden>
- Date: Tue, 27 Jan 2009 01:49:04 -0500
On Jan 26, 2009, at 7:45 PM, I. Savant wrote:
... sorry?
How does implementing one delegate method that's directly targeted
at the very problem you're trying to solve "complicate things"?
I was confused about what to return from the method if I just wanted
the data cell preserved as is. It turned out to be really simple, but
the solution didn't hit me on the first few passes.
- (NSCell *) tableView:(NSTableView *) tableView
dataCellForTableColumn:(NSTableColumn *) tableColumn
row:(NSInteger) row
{
if ([[tableColumn identifier] isEqualToString: @"delete"] &&
(row == [[controller arrangedObjects] count] - 1))
return addCell;
else
return [tableColumn dataCellForRow: row];
}
Thanks for your help. It was in typing up a rebuttal, that I stumbled
upon this solution. Simple, clean, elegant. I guess delegates DO have
a purpose :)
Thanks again
- Ken
_______________________________________________
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