0
我有一个可编辑的分组tableView,但刷卡删除不起作用。它看起来像刷卡 - 删除应该与UITableViewCellEditingStyleDelete一起,但它似乎并不适合我。这是我编辑样式的方法:TableView滑动删除不起作用
- (UITableViewCellEditingStyle)tableView:(UITableView *)table editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 1)
{
if (indexPath.row < [[device_coordinator getChannelList] count]) return UITableViewCellEditingStyleDelete;
else if (indexPath.row < [[device_coordinator getChannelList] count]+2) return UITableViewCellEditingStyleInsert;
}
return UITableViewCellEditingStyleNone;
}
这使得表格看起来正确。有些单元格的左侧有插入图标,有些单元格会删除图标,因为它们应该如此。按下删除图标将显示删除确认按钮。但一个刷卡不!
即使我只是返回空白,从我的cellForRowAtIndexPath方法新分配的单元格,它仍然无法正常工作,所以看起来我的单元格中没有任何内容导致问题。在4.3模拟器和我的iPod touch 2g上发生同样的问题。
你说得对!我希望能够同时做到这一点。但至少我知道现在不行的原因。我认为我的应用程序闹鬼。 – Randall