Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

detz

macrumors 65816
Original poster
Jun 29, 2007
1,051
0
I've been trying to get this to work all day and I just can't get it. I have two items showing in the cell but I can't figure out how to change the text once it's there.

CustomCell

Would I have to do something in this method?

PHP:
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex{
	NSLog(@"%@ - %d",aTableColumn, rowIndex);
	if ([[aTableColumn identifier] isEqualToString:@"Title"]){
             //something to change the values?
	}
	
    return [title objectAtIndex:rowIndex];
}

The picture shows what I'm trying to do, I need to change both of those values under Title.
 

Attachments

  • Picture 2.png
    Picture 2.png
    11.2 KB · Views: 69

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
There are two ways. One would be to use your current method and return some object that stores both values (such as a dictionary) and then retrieve that dictionary in your custom cell via the objectValue method (or override the setObjectValue: method and update your text fields there), or write accessor methods to those text fields in the cell and set them appropriately in tableView:willDisplayCell:forTableColumn:row:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.