我NSJsonSerilization
用来获取UITableView
单元格中的 JSON 数据。我已将数组声明为 .NSMutableArray
但我仍然得到
-[__NSCFArray removeObjectAtIndex:]: mutating method sent to immutable object error
每当我尝试删除单元格时,应用程序就会崩溃。
cell.nameLabel.text = [[jsonResults objectAtIndex:indexPath.row] objectForKey:@"FromProviderName"];
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
[jsonResults removeObjectAtIndex:indexPath.row];
[jsonTable reloadData];
}
我试图查找之前回答的解决方案,我正在做同样的事情。谢谢!