UITableView not reloading data on [self.tableView reloadData]
- by donnib
I have following code :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
static NSString *RowListCellIdentifier = @"RowListCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RowListCellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:RowListCellIdentifier]autorelease];
}
NSMutableString *rowString = [[NSMutableString alloc] init];
[rowString appendString:[[[rows objectAtIndex:row] firstNumber]stringValue]];
[rowString appendString:@" : "];
[rowString appendString:[[[rows objectAtIndex:row] secondNumber]stringValue]];
[rowString appendString:@" : "];
[[cell textLabel] setText:rowString];
[rowString release];
return cell;
}
- (void)viewWillAppear:(BOOL)animated {
[self.tableView reloadData];
[super viewWillAppear:animated];
}
My problem is that the textLabel does not get reloaded with new data. If i log the rowString i see the correct value so data is good but in the UI it's the old data. I can see the cellForRowAtIndexPath beeing called so i know the reloadDatacall goes thru. What am i doing wrong ?