Erweiterbar & auch zerlegbar UITableView Abschnitte von NSMutableArray

Hallo ich habe eine Tabelle mit Daten aus einer json-mit Adressen, ich leite Sie zu Sortieren durch die Nachbarschaft, die bei drücken einer Taste, ich würde gern erweiterbar & auch zerlegbar Abschnitte mit den Vierteln mit der gleichen Taste.

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] init];
}
NSString *cellName = [[myArray objectAtIndex:indexPath.row] valueForKeyPath:@"name"];
NSString *cellState = [[myArray objectAtIndex:indexPath.row] valueForKeyPath:@"desc"];
NSString *cellTodo = [NSString stringWithFormat:@"%@: %@", cellState, cellName];
[[cell textLabel] setFont:[UIFont systemFontOfSize: 11.0]];
cell.textLabel.text = cellTodo;
return cell;
}


- (IBAction)PorBarrio:(id)sender {
NSSortDescriptor * sortDesc = [[NSSortDescriptor alloc] initWithKey:@"desc" ascending:YES];
[myArray sortUsingDescriptors:[NSArray arrayWithObject:sortDesc]];
[myTableView reloadData];
}
InformationsquelleAutor dastjuso | 2013-07-03
Schreibe einen Kommentar