首页 > 移动平台 > 详细

IOS中的table的写法的一些解释

时间:2014-11-10 17:12:41      阅读:229      评论:0      收藏:0      [点我收藏+]

在表格中显示单元格

  1. 在项目导航器中,选择 XYZToDoListViewController.m

  2. 找到 tableView:cellForRowAtIndexPath: 数据源方法。模板实现是这样的:

    1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    2. {
    3. static NSString *CellIdentifier = @"Cell";
    4. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    5. // Configure the cell...
    6. return cell;
    7. }

    该模板执行多个任务。它会创建一个变量来保存单元格的标识符,向表格视图请求具有该标识符的单元格,添加一个注释注明配置该单元格的代码应该写在哪里,然后返回该单元格。

IOS中的table的写法的一些解释

原文:http://www.cnblogs.com/memorecool/p/4087288.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!