Ich habe eine Liste von Zuständen in UITableView. Jetzt möchte ich mehrere Zeile von UITableView auswählen und möchte diese ausgewählten Zeilenwerte in einem Array erhalten. Wie kann ich das bekommen?Wie erhält man mehrere ausgewählte Zeilenwerte aus der uitableview und speichert mehrere ausgewählte Werte im Array?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//NSMutableArray *arrData =[statearray objectAtIndex:indexPath.row];
NSLog(@"arrdata>>%@",statearray);
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
cell.textLabel.text = [statearray objectAtIndex:indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
}
Geben Sie den ÜbertragungstabellenView-Bearbeitungsmodus ein und speichern Sie den ausgewählten Status – Allen