2011-10-13 4 views

답변

0

선택한 셀의 [indexPath 행]을 배열에 추가 할 수 있습니다. 그리고 나중에 사용하십시오. NSMutableArray * selectedCellsArray; // 아이바는 somwhere 구현하여있는 tableView didSelectRowAtIndexpath 위임 방법에

selectedCellsArray = [[NSMutableArray alloc] init]; 

에서 :

[selectedCellsArray addObject:[NSNumber numberWithInt:[indexPath row]]]; 

배열은 indexPath 행을 선택있는 tableView의 모든 셀이있을 것이다.

+0

나는 위의 코드로 시도했지만 셀 데이터를 가져올 수 없습니다. 사용자가 여러 행을 선택한 경우 해당 데이터가 필요합니다. – user949932

0

로직으로 할 수 있으며 셀을 선택할 때마다 셀에서 체크 표시로 변경할 수 있습니다.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
     { 
      // change this row as selected 
      //add the value in an array and use tat at the end 
     } 
관련 문제