gpt4 book ai didi

swift - deleteRowsATIndexPaths 崩溃

转载 作者:搜寻专家 更新时间:2023-11-01 05:59:31 25 4
gpt4 key购买 nike

<分区>

我试图在稳定 View 中删除一行,但每次我在应用程序中选择删除时它都会因此错误而崩溃

Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (3) must be equal to the number of rows contained in that section before the update (3), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'

这是我删除行的方式。

func tableView(tableView: UITableView!, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath!){

tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation:UITableViewRowAnimation.Fade)

}

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