【发布时间】:2011-12-08 07:47:06
【问题描述】:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier ];
if(cell == nil){
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
cell.text = [[views objectAtIndex:indexPath.row] objectForKey:@"title"];
return cell;
}
为什么我们在这里使用 CellIdentifier,为什么它是静态的?
【问题讨论】:
标签: iphone ios uitableview static identifier