我在我的UITableView中有四个部分,如何为每个部分添加标题? 我正在使用下面的代码,但它不工作。如何为表格中的每个部分添加标题标题
- (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";
}
什么是'@ switch',它与switch'有什么不同? – Richard 2011-04-11 15:27:22
我相信它们是一样的东西...... – matteodv 2011-04-11 16:37:29
没有'@ switch'。我认为这是一个错字。 ;) – 2011-04-11 16:48:25