【发布时间】:2018-04-16 16:13:46
【问题描述】:
我有一个字符串,我想用一个按钮在表格视图中动态添加一个单元格,使用该字符串作为按钮的标题。
我找到了这段代码:
[self.array addObject:@"string"];
[self.tableView beginUpdates];
NSArray *arr = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:self.array.count-1 inSection:0]];
[self.tableView insertRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView endUpdates];
但它什么也没做。
【问题讨论】:
标签: ios objective-c uitableview cocoa-touch row