【发布时间】:2013-04-02 19:07:14
【问题描述】:
我有一个 UIViewController,它在某些时候会增长一个 UITableView,当它发生时,我只需初始化 TableView 实例变量并将其添加到视图中,但我不确定如何处理单元格的出列以添加到看法;我需要一个重用标识符,但我不知道如何设置它。
我在这个方法中做什么?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"wot";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
return cell;
}
【问题讨论】:
-
在
cellForRowAtIndexPath的任何实现中,您都会做同样的事情。您获得表格视图的方式并没有改变表格视图的工作方式。您展示的代码是一个非常好的开始。
标签: iphone ios objective-c uitableview uiviewcontroller