Re: Replacing a tableView Cell with null
Re: Replacing a tableView Cell with null
- Subject: Re: Replacing a tableView Cell with null
- From: Corbin Dunn <email@hidden>
- Date: Mon, 08 Jun 2009 08:48:25 -0700
- (NSCell *)tableView:(NSTableView *)tableView
dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)
row AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Thanks a lot, that seems to work really well. However, because I'm
only specifying the cell for one column how do I get out of the
method without messing with the other columns. I get the following
warning;
- (NSCell *)tableView:(NSTableView *)tableView
dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)
row
{
NSCell *cell = [NSCell alloc];
if ([[tableColumn identifier] isEqualToString:@"budget"]) {
//Fetch account type
Account *selectedAccount = [[accountsController arrangedObjects]
objectAtIndex:row];
if ([[selectedAccount valueForKeyPath:@"type.name"]
isEqualToString:@"Assets"]
|| [[selectedAccount valueForKeyPath:@"type.name"]
isEqualToString:@"Liabilities"]){
[cell initTextCell:@""];
return (cell);
}
}
return;
}
warning: 'return' with no value, in function returning non-void
___
return [tableColumn dataCell];
also note you have a memory leak, you want return [cell autorelease],
and probably don't want to alloc the cell until you need it.
--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