码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-11-10 17:15:14      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:io   ar   os   sp   for   strong   数据   div   on   

在表格中显示单元格

  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的写法的一些解释

标签:io   ar   os   sp   for   strong   数据   div   on   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!