Этот код не работает должным образом и не загружает полные данные в первый раз и отлично работает со следующего раза после прокрутки.
#define ROW_HEIGHT 110
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog( @"Setting table text." );
static NSString *CellIdentifier = @"Transaction";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
[cell addSubview:[[UILabel alloc] initWithFrame:CGRectMake(40.0, 0.0, 280.0, ROW_HEIGHT - 1)]];
}
NSUInteger row = [indexPath row];
NSLog( @"Table cell text: %@", [[transactionHistory objectAtIndex:row] description] );
UILabel *labelText = [[cell subviews] lastObject];
labelText.text = [[transactionHistory objectAtIndex:row] description];
labelText.font = [UIFont systemFontOfSize:14];
labelText.lineBreakMode = UILineBreakModeWordWrap;
labelText.numberOfLines = 5;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return ROW_HEIGHT;
}
Что может быть не так?