【发布时间】:2011-01-10 04:58:27
【问题描述】:
我需要在我定义的函数中删除表的第 1 行。为了使用deleteRowAtIndexPath,您必须使用IndexPath,并定义了部分和行。如何创建这样的索引路径?
以 int {1} 作为唯一成员的数组将崩溃; NSLog 消息指出该部分也需要定义。
*Edit -> 删除单元格相关代码:
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];
【问题讨论】:
标签: ios iphone uitableview nsindexpath