How can i select multiple rows from table view and how to get data from that?
How can i select multiple rows from a table view and i need to g开发者_高级运维et that data(Cell) which were selected by the user.
Thanks
You can add selected Cell's [indexPath row] to an Array. And use it later. NSMutableArray* selectedCellsArray; // iVar then somwhere in your implementation
selectedCellsArray = [[NSMutableArray alloc] init];
in your tableView didSelectRowAtIndexpath delegate method:
[selectedCellsArray addObject:[NSNumber numberWithInt:[indexPath row]]];
your array will have all of selected tableView cells indexPath row.
You can do with your logic and For every select you can change as Checkmark at the cell.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// change this row as selected
//add the value in an array and use tat at the end
}
精彩评论