【点滴】iOS开发基础-UITableView
时间:2010-11-17 来源:wilmer
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section{
return [model getRowCount];
}
//返回UITableView的行数
- (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];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [model getNameAtIndex:row];
return cell;
}
//呈现UITableView的每一个Cell
相关阅读 更多 +
排行榜 更多 +










