Re: TableView displaying a zillion empty rows
Re: TableView displaying a zillion empty rows
- Subject: Re: TableView displaying a zillion empty rows
- From: Greg Guerin <email@hidden>
- Date: Mon, 6 Jul 2009 11:50:14 -0700
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 (email@hidden)
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:
This email sent to email@hidden