Hi Guys
I have a UIView and on it i have place a tableview, the tableview uses custom cells fed data from an NSArray. Some strangeness going on in that at most I can only ever get the table to display 2 cells even though there are 10 cells there and all 10 are populated.
I have a different nib arranged the same way and it works perfect.
Screenshot of what is happening (5 is the 5th of 10 cells all of which are populated with data).
http://img692.imageshack.us/img692/1465/screenshot20100708at215.jpg
-(UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"ISB points cellForRowAtIndexPath start");
NSLog(@"Elements in array = %d",[self.listData count]);
//
static NSString *cellID = @"PointsCellIdentifier";
PointsCustomCell *cell = [tblView dequeueReusableCellWithIdentifier:cellID];
if( cell == nil )
{
NSArray *nibObjects = [[NSBundle mainBundle]loadNibNamed:@"PointsCustomCell" owner:nil options:nil];
for( id currentObject in nibObjects )
{
NSLog(@"nibObjects count = %d", [nibObjects count]);
if( [currentObject isKindOfClass:[PointsCustomCell class]] )
{
cell = (PointsCustomCell *)currentObject;
}// if
}// for
}// if
if( indexPath.row < [listData count] )
{
RiderPointsData *riderPts = (RiderPointsData *)[listData objectAtIndex:indexPath.row];
cell.posLabel.text = riderPts.pos;
cell.nameLabel.text = riderPts.name;
cell.pointsLabel.text = riderPts.points;
cell.winsLabel.text = riderPts.wins;
//[riderPts release];
}
NSLog(@"ISB points cellForRowAtIndexPath end");
return cell;
}