[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSTableView issue
From: |
Andreas Höschler |
Subject: |
NSTableView issue |
Date: |
Mon, 11 Sep 2006 14:09:46 +0200 |
Hello all,
I wondered why I could not select (Copy) a cell in a tableView in one
of our apps. I finally found that thi sis due to
- (void) setDataSource: (id)anObject
{
/* Used only for readability */
const SEL sel_a = @selector (numberOfRowsInTableView:);
const SEL sel_b = @selector
(tableView:objectValueForTableColumn:row:);
const SEL sel_c =
@selector(tableView:setObjectValue:forTableColumn:row:);
if (anObject && [anObject respondsToSelector: sel_a] == NO)
{
[NSException
raise: NSInternalInconsistencyException
format: @"Data Source doesn't respond to numberOfRowsInTableView:"];
}
if (anObject && [anObject respondsToSelector: sel_b] == NO)
{
[NSException raise: NSInternalInconsistencyException
format: @"Data Source doesn't respond to "
@"tableView:objectValueForTableColumn:row:"];
}
_dataSource_editable = [anObject respondsToSelector: sel_c];
NSLog(@"setDataSource %@ %@ %d", anObject,
NSStringFromSelector(sel_c), _dataSource_editable);
/* We do *not* retain the dataSource, it's like a delegate */
_dataSource = anObject;
[self tile];
[self reloadData];
}
_dataSource_editable being NO. I have not implemented
tableView:setObjectValue:... in my data source, sincen I do not
actually want ti edt the cells, but I wantto be able to select and copy
from the columns I set to be editable. On MacOSX this works. A solution
tomake this working on GNustep would be to implement the method in
question and simply do nothing. But may be the SPEC sould be checked
here. MacOSX at least behaves differently.
Regards,
Andreas
- NSTableView issue,
Andreas Höschler <=