从uitableview中删除行

编程入门 行业动态 更新时间:2024-10-22 16:23:01
本文介绍了从uitableview中删除行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我只是尝试使用以下代码从 UITableView 中删除​​一行:

I simply try to delete a row from a UITableView with the following code:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; } }

问题是我的应用程序崩溃了。 (GDB:Program received signal:EXC_BAD_INSTRUCTION。)任何人都知道为什么?

The problem is that my app crashes. (GDB: Program received signal: "EXC_BAD_INSTRUCTION".) Anybody know why?

推荐答案

返回的数字

- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section

为 indexPath.section 。

更多推荐

从uitableview中删除行

本文发布于:2023-10-23 13:55:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1521015.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:uitableview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!