Ariel29
2016-01-24 08:06iOS 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条回答
为你推荐
- oc开发ios项目:用代码写控件,添加tableview时出现警告,把控件添加到view时报错
- 控件
- ios
- 界面
- uiviewcontroller
- 3个回答
- ios10后 tableview设置分割线无效
- separatorstyle
- ios
- swift
- uitableview
- 4个回答
- iOS tableView.tableHeaderView 怎样改变跟随与不跟随cell滑动.
- 1个回答
- swift tableview 刷新
- 刷新
- cell
- tableview
- 复选
- swift
- 4个回答
- IOS tableView 显示不全问题
- 显示不全
- ios
- tableview
- 4个回答
换一换