- (void)viewWillAppear:(BOOL)animated
{
一次性获得数据,方便在- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath 中绘制单元。
[tableView reloadData];
}
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *kCellIdentifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:kCellIdentifier] autorelease];
}
switch (indexPath.row) {
case 0: {
cell.text = [NSString stringWithFormat:NSLocalizedString(@"Mean Download Time: %fs", @"Mean Download Time format"), MeanDownloadTimeForParserType(indexPath.section)];
} break;
case 1: {
cell.text = [NSString stringWithFormat:NSLocalizedString(@"Mean Parse Time: %fs", @"Mean Parse Time format"), MeanParseTimeForParserType(indexPath.section)];
} break;
case 2: {
cell.text = [NSString stringWithFormat:NSLocalizedString(@"Mean Total Time: %fs", @"Mean Total Time format"), MeanTotalTimeForParserType(indexPath.section)];
} break;
}
return cell;
}