使用自定义单元格:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Custom";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:CellIdentifier] autorelease];
}
CGRect *customframe = CGRectMake(2, 2, 250, 30); **// Set the frame** as per your own.
UILabel *lbl = [[UILabel alloc] initWithFrame:customframe];
lbl.text = [resultater objectAtIndex:indexPath.row]; **// Set the label value from array**
[cell.contentView addSubview:lbl];
[lbl release];
return cell;
}