The code provided looks very unusual and clearly does not follow the 
Model-View-Controller design.  It is almost always a bad idea to store 
information in the user interface.  
 
The following line is extremely suspect:
int count =  _browserView->fileList.GetCount();
 
Why doesn't your tableView's data source have its own direct reference to 
fileList ?
 
I suggest the following:
 
- (int)numberOfRowsInTableView:(NSTableView *)tableView {
   int count = 0;

   if(_fileList != NULL)
   {
       count = _fileList.GetCount();
   }
   
   return count;
}

 
What is going on with the following?
       [_browserView selectAll:self];
       [_browserCells release];
       _browserCells = [_browserView selectedCells];
       [_browserCells retain];        

Don't select stuff in - (int)numberOfRowsInTableView:
 
Even if you wanted the cells from the matrix for some reason, why not
[_browserCells release];
_browserCells = [[_browserView cells] copy];
 
But using the cells of a matrix outside the matrix is extremely suspect.  The 
cells should not contain any information that you can't get from some other 
source like _fileList.
 
The rest of teh code that copies information out of cells in a matrix in order 
to set information in cells used by a tableView  is so horrific that I won't 
comment any more.  Please read about Model-View-Controller.
 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to