Ariel29 2016-01-24 08:06 采纳率: 0%
浏览 2197

iOS tableview的indexPath.row 显示时从1开始,下拉之后会显示0

 -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.array.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"indexpath.row:%lu",indexPath.row);

    static NSString *identity = @"UITableViewCell";

    [self.tableView registerClass:[ApplyTableViewCell class] forCellReuseIdentifier:identity];

    ApplyTableViewCell *applyCell = [self.tableView dequeueReusableCellWithIdentifier:identity forIndexPath:indexPath];

    if (applyCell == nil) {
        applyCell = [[ApplyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identity];

    }

    _cell = applyCell;

    _cell.showViewDelegate = self;

    applyCell.replyArr = self.replyArr;
    applyCell.model = self.array[indexPath.row];

    return applyCell;
}

求解答

  • 写回答

4条回答 默认 最新

  • b1458583930 2016-01-24 11:52
    关注

    坐标超了 ,还要十个字符

    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题