iOS开发:UITableView编辑——cell的删除和移动
首先在昨天的基础上添加一个sectionArray数组(详见《UI第九天:UITableView简单介绍》)
self.sectionArray= [NSMutableArrayarrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",nil];
#pragma mark section的个数(分区个数)
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return_sectionArray.count;
}
#pragma mark 显示section分区的标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return [_sectionArrayobjectAtIndex:section];
}
#pragma mark 分区标题的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 100;
}
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return _sectionArray;