gpt4 book ai didi

ios - 无效更新 : invalid number of rows in section

转载 作者:行者123 更新时间:2023-11-28 21:07:38 25 4
gpt4 key购买 nike

我收到此错误消息,我不知道该怎么做或如何调试:

'无效更新:第 1 节中的行数无效。更新后现有节中包含的行数 (7) 必须等于更新前该节中包含的行数 (7) ), 加上或减去从该部分插入或删除的行数(0 插入,1 删除),加上或减去移入或移出该部分的行数(0 移入,0 移出)。'

我的表中有 3 个部分。这是我的数据源发生任何更改之前每个部分中的行数:

// Check current data source
date source for section 0: 1 items
data source for section 1: 8 items
data source for section 2: 8 items

sections count: 3
section 0 1 rows
section 1 8 rows
section 2 8 rows

以下是我从第 1 部分删除一行并将其移至第 2 部分后打印出的内容:

// Updated my date source
date source for section 0: 1 items
data source for section 1: 7 items
data source for section 2: 9 items

sections count: 3
section 0 1 rows
section 1 7 rows
section 2 9 rows

// Then the crash message happen

请帮忙。谢谢。

最佳答案

在调用 deleteRowsAtIndexPaths:withRowAnimation 之前,您需要从数据数组中删除该对象。

Basically the same question in stackoverflow

关于ios - 无效更新 : invalid number of rows in section,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44894277/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com