0
我想在运行时动态地添加/删除单元格到我的分组表格。这是我有史以来第一个创建的应用程序,虽然我尝试了许多其他人的建议,但我仍然没有得到它的工作。这里是我的代码,我使用:从UITableView中的分组部分添加/删除单元格
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
UILabel *lblName = (UILabel *)[cell viewWithTag:100];
[lblName setText:[intervalArray objectAtIndex:[indexPath row]]];
return cell;
在哪里,你要添加/移除细胞的代码? –
备注:dequeueReusableCellWithIdentifier:可能返回零;你需要检查并分配一个新的UITableViewCell。 –