Это стандартная реализация:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [table objectAtIndex:indexPath.row];
return cell;
}
В качестве дополнительного примечания это реализация ARC.Если вы не используете ARC, просто добавьте autoRelease:
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]autoRelease];
и убедитесь, что ваш dataSource numberOfSections установлен правильно:
return 1;
и numberOfRows установлено в массив:
return [table count];