我需要在我定义的函数中删除表的第 1 行。为了使用deleteRowAtIndexPath
,您必须使用IndexPath
定义了节和行的 an。如何创建这样的索引路径?
以 int {1} 作为唯一成员的数组将崩溃;NSLog 消息指出该部分也需要定义。
*编辑->与单元格删除相关的代码:
NSIndexPath *myIP = [[NSIndexPath alloc] indexPathForRow:0 inSection:0];
NSArray *myArray = [[NSArray alloc] initWithObjects:myIP, nil];
// [self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:myArray withRowAnimation:UITableViewRowAnimationFade];
// [self.tableView endUpdates];