我有一个UIViewController,在某个时候会增加一个UITableView,当它增加时,我只需初始化TableView实例变量并将其添加到视图中,但我不确定如何处理从视图中取消排队的单元格; 我需要一个重用标识符,但我不确定如何设置它。
在这个方法中,我该怎么做?
在这个方法中,我该怎么做?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"wot";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
return cell;
}
cellForRowAtIndexPath
的任何实现中做相同的事情。获取表格视图的方式不会改变表格视图的工作方式。你展示的代码是一个完美的起点。 - matt