Re: NSTableView identify problem
Re: NSTableView identify problem
- Subject: Re: NSTableView identify problem
- From: Volker Bublitz <email@hidden>
- Date: Sat, 11 Jan 2003 16:31:51 +0100
yep,
thanks very much. this works just fine :-)
i tried both solutions....
volker
Am Freitag, 10.01.03 um 22:38 Uhr schrieb Scott Anguish:
On Friday, January 10, 2003, at 02:15 PM, Volker Bublitz wrote:
hi,
i'm using one class as a data source for four NSTableViews ... i set
the NSTableColumn of the header to a different name and identifier.
when the method
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)row;
is triggered i need to know which NSTableView aTableView really is..
how can i access information about the title or another identifier
for NSTableViews?
i know i can get the NSTableHeaderView - but how can i get the header
NSTableColumn to check its identifier? or is there another way?
I'd suggest keeping the instances of each table row in variables, and
then you can just compare the aTableView instance with the saved
values.
So connect the individual tables in IB to outlets
NSTableView *namesTableView;
NSTableView *itemsTableView;
NSTableView *grogsTableView;
NSTableView *grogsDetailsTableView;
and then just compare in your code
if ([aTableView isEqual:namesTableView]) {
do something;
}
etc..
Or... you could set tags on the different NSTableViews in Interface
Builder, and then compare the tags...
#define NamesTableTag 1
if ([aTableView tag] == NamesTableTag) {
do something;
}
Am Samstag, 11.01.03 um 03:58 Uhr schrieb Quentin Mathi:
Le vendredi, 10 jan 2003, ` 20:15 Europe/Paris, Volker Bublitz a icrit
:
i'm using one class as a data source for four NSTableViews ... i set
the NSTableColumn of the header to a different name and identifier.
when the method
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)row;
is triggered i need to know which NSTableView aTableView really is..
how can i access information about the title or another identifier
for NSTableViews?
You can use the tag (in this case, it's better to have the different
tables in the same window) or the autosave name, you can set these two
properties in the IB inspector for TableView.
i know i can get the NSTableHeaderView - but how can i get the header
NSTableColumn to check its identifier? or is there another way?
Check the identifier for the NSTableColumn.
--
Quentin Mathi
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.