本文介绍了从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中删除行
发布评论