следующий код работает правильно, но он применяет один и тот же текст ячейки ко всем разделам. Как я могу применить выбор выбора также в зависимости от раздела? Спасибо.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
switch (indexPath.row) {
case 0:
cell.textLabel.text = @"English";
break;
case 1:
cell.textLabel.text = @"Chinese";
break;
case 2:
cell.textLabel.text = @"Japanese";
break;
default:
break;
}
return cell;
}