bindings, NSTableView and overriding drawRow
bindings, NSTableView and overriding drawRow
- Subject: bindings, NSTableView and overriding drawRow
- From: Byron Wright <email@hidden>
- Date: Tue, 23 Nov 2004 15:25:00 -0800
I am attempting to override drawRow in a subclass of NSTableView and
don't want to break binding support. I don't want to draw using a
custom cell because I would like to be able to use different data cells
for different columns. So my question is, how can one programatically
query the NSTableColumn's binding information to figure out the key
paths? So say the column has been bound like :
[aNameCol bind:@"value" toObject :myController
withKeyPath:@"arrangedObjects.name" options:someOptions];
so in my draw row method:
- (void)drawRow:(int)rowIndex clipRect:(NSRect)clipRect
{
//do some custom drawing here....
//now tell cells to draw themselves
NSRange cols = [self columnsInRect:clipRect] ;
int current = cols.location;
int end = cols.length+start;
for(current; current<end; ++current)
{
NSTableColumn * currentCol = (NSTableColumn*)[[self tableColumns]
objectAtIndex:current];
//need to value column to set the cells objectValue
//Can't call [currentCol value] because NSTableColumn or
NSObject do not what this method or attribute.
//call tableView delegate like NSTableView does
}
}
I cannot seem to find any information in the docs on how to query an
objects bindings.
Thanks in advance,
Byron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden