• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
DataSource class of NSTableView - weird
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: DataSource class of NSTableView - weird
      • From: Chris Hanson <email@hidden>
    • Re: DataSource class of NSTableView - weird
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: itunes for windows HOWTO ???
  • Next by Date: Re: itunes for windows HOWTO ???
  • Previous by thread: Re: itunes for windows HOWTO ???
  • Next by thread: Re: DataSource class of NSTableView - weird
  • Index(es):
    • Date
    • Thread