Я немного смущен о принадлежностях ячейки таблицы настроек.
Я зафиксировал два раздела в моей таблице
- Главная
- Управление
Чего я хочу, как следует...
- Когда пользователь нажимает любую ячейку
- Ячейка выбирается и
- Я хочу установить флажок (установить тип аксессуара uitableviewcell -checked из прослушанной ячейки)
- А также все другие типы аксессуаров для аксессуаров теперь должны
- подходящий вид сотовый аксессуар тип нет
Я пробовал следующий код. Но я обнаружил, что indexpath.row и indexpath.section являются свойствами readonly.
// Override to support row selection in the table view.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tblProfileView deselectRowAtIndexPath:indexPath animated:YES];
int i,max;
UITableViewCell *x; NSIndexPath *tt;
for(i=0;i<[tblProfileView numberOfRowsInSection:0];i++)
{
tt.row=i; tt.section=0;
x=[tblProfileView cellForRowAtIndexPath:];
[x setAccessoryType:UITableViewCellAccessoryNone];
}
for(i=0;i<[tblProfileView numberOfRowsInSection:1];i++)
{
tt.row=i; tt.section=1;
x=[tblProfileView cellForRowAtIndexPath:tt];
[x setAccessoryType:UITableViewCellAccessoryNone];
}
x=[tblProfileView cellForRowAtIndexPath:indexPath];
[x setAccessoryType:UITableViewCellAccessoryCheckmark];
// Navigation logic may go here -- for example, create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController animated:YES];
// [anotherViewController release];
}