Re: Selectively using formatter in table view text cell
Re: Selectively using formatter in table view text cell
- Subject: Re: Selectively using formatter in table view text cell
- From: Graham Cox <email@hidden>
- Date: Wed, 24 Jun 2009 16:36:23 +1000
On 24/06/2009, at 4:00 PM, Quincey Morris wrote:
(a) Use the delegate, something like (untested, obviously):
-(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
if (!<this is the correct column>)
return;
id objectValue = [self.delegate tableView: self
objectValueForTableColumn:aTableColumn row:rowIndex;
// or find the data directly from your data model, if not using a
data source
if (objectValue isKindOfClass: [NSNumber class])
aCell.formatter = myFormatter;
else
aCell.formatter = nil;
}
Thanks! That works fine and was very easy...
--Graham
_______________________________________________
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