我在表格视图中有4个部分如何为每个部分添加标题我正在编写follwing代码,但它不工作。为表格中的每个部分添加标题标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection: (NSInteger)section {
if (section == 0)
return @"Tasks";
if (section == 1)
return @"Appointments";
if (section == 2)
return @"Activities";
if (section == 3)
return @"Inactivities";
}