Brian Hughes wrote:

    -(int) numberOfRowsInTableView: (NSTableView *)aTableView
{
          int returnValue;
        
          if (aTableView == gameScoresTableView) //This works as expected
          {
                if (currentIndex_>= 0)
                {
LNPlayer *currentPlayer = [playersArray objectAtIndex: currentIndex_]; NSMutableArray *tempGameRecordsArray = [NSMutableArray arrayWithArray: [currentPlayer gameRecordsArray]];
                        returnValue = [tempGameRecordsArray count];
                }
                else
                {
                        NSBeep ();
                        NSLog (@"ERROR in LNAppController -- 
numberOfRowsInTableView:");
                        return -1;
                }
                
          }
else if (aTableView == playerManagementTableView) //This is the one that doesn't work
          {
                returnValue = [playersArray count];  //[playersArray count] = 22
                NSLog (@"playersArray count = %d", returnValue);  //returnValue 
= 22
          }
        
return returnValue; //However if I change this to: return returnValue = 22 it works fine!
    }

What will returnValue be if aTableView is neither gameScoresTableView nor playerManagementTableView?

Looks like an uninitialized local variable.

  -- GG

_______________________________________________

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