• 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
Re: TableView displaying a zillion empty rows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: TableView displaying a zillion empty rows
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Re: NSApplication and UIApplication
  • Next by Date: How to share Cocoa classes?
  • Previous by thread: Re: TableView displaying a zillion empty rows
  • Next by thread: Re: TableView displaying a zillion empty rows
  • Index(es):
    • Date
    • Thread