I have the following method that should populate the cells of my UITableView with data from an array. I want to get the data from the array using the row that the data is being loaded into as the index.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cellComments=(FullCommentCell *)[tableView dequeueReusableCellWithIdentifier:FullCommentCell_ID];
if(cellComments==nil)
{
[[NSBundle mainBundle]loadNibNamed:@"FullCommentCell" owner:self options:nil];
NSLog([NSString stringWithFormat:@"%i",indexPath.row]);
[cellComments loadFullComments:[latestFMLComments objectAtIndex:indexPath.row]];
}
//cellComments.userInteractionEnabled=NO;
return cellComments;
}
This is not working as expected. The table only ends up being populated with the first three elements of my array and then this data is reused until my table ends. The table should be using all the data from my array. Any idea why this is not working as expected?