DataSource class of NSTableView - weird
DataSource class of NSTableView - weird
- Subject: DataSource class of NSTableView - weird
- From: Kai <email@hidden>
- Date: Mon, 10 Nov 2003 14:27:47 +0100
Hi all,
I have a data source class for a NSTableView:
--begin--
- (id)init {
[super init];
db_tables = [[NSMutableArray alloc] init]; // "db_tables" is a global
array, defined in the header file.
return self;
}
- (void)fillTableList:(NSArray *)currentTables {
[db_tables removeAllObjects];
[db_tables addObjectsFromArray:currentTables];
[TablesList reloadData]; // TablesList is the outlet for the
NSTableView.
}
- (int)numberOfRowsInTableView:(NSTableView*)table {
return [db_tables count];
}
- (id)tableView:(NSTableView*)table
objectValueForTableColumn:(NSTableColumn*)column row:(int)row {
return [db_tables objectAtIndex:row];
}
--end--
If I call "fillTableList" (with a filled array) from another class, the
table view remains empty. "db_tables" shows the
content of the handed over array, but in "numberOfRowsInTableView" it
shows count = 0 and the array is empty.
If I call the "fillTableList" in the "awakeFromNib" method (with a
filled array again) the table view shows all entries
in "db_tables" array.
I don't know why! Why is the array in any method filled and in an other
empty? I don't understand that!
Someone has an idea ?
Thanks in advace
Kai
_______________________________________________
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.