gpt4 book ai didi

iphone - UIKit//UITableView.m中的[UITableView _endCellAnimationsWithContext:]断言失败

转载 作者:行者123 更新时间:2023-12-03 16:13:51 24 4
gpt4 key购买 nike

我的应用程序崩溃,并显示在该线程标题中的消息。 UITableView.m中的断言失败。此外,在Xcode的调试窗口中还有以下消息。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to insert section 2 but there are only 2 sections after the update'



这很奇怪,因为更新前后的节数似乎是3。我在这里控制节数:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView  
{
if (editMode)
{
if ( [device typeA]) {

if ( [device typeB])
return 1;
else
return 2;


}

提示:我想“隐藏”最后一部分

最佳答案

如果您在添加部分后仍返回2作为部分数,则iOS当然认为存在问题。您应该以其他方式隐藏部分,例如将其标题高度设置为0。

关于iphone - UIKit//UITableView.m中的[UITableView _endCellAnimationsWithContext:]断言失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16234993/

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