либо вы используете пользовательскую ячейку, либо вы используете обычные UITableViewCells.
Это код, который вы можете использовать для стандартного UITableViewCell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
//cell.textLabel.text = [array1 objectAtIndex:indexpath.row]; // Hotel Royal
//cell.detailTextLabel.text = [array2 objectAtIndex:indexpath.row]; // First
cell.textLabel.text = [array objectAtIndex:0]; // Hotel Royal
cell.detailTextLabel.text = [array objectAtIndex:1]; // First
return cell;
}
вместо UITableViewCellStyleValue1, который вы можете проверить, если один из другихстили подходит для ваших нужд.UITableViewCellStyleSubtitle или UITableViewCellStyleValue2