UITableViewCell Тип аксессуара отмечен на Tap & Установить другой не отмечен

Я немного запутался в настройках таблицы просмотра сотовых аксессуаров.

Я исправил два раздела в моей таблице

Главнаяофис

Что я хочу, так это следовать ....

Когда пользователь нажимает на любую ячейкуЯчейка выбирается иЯ хочу установить флажок (установить тип аксессуара uitableviewcell -checked для подключенной ячейки)А также тип аксессуара для всех остальных ячеек теперь должен быть установлен натип аксессуара для удобного вида

Я пробовал следующий код. Но я обнаружил, что indexpath.row & indexpath.section - это свойства только для чтения.

// 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];
}

Ответы на вопрос(9)

Ваш ответ на вопрос