小编use*_*816的帖子

indexPath在所有行中返回0

我创建了一个tableView只有1个部分,它总是返回0 indexPath.Row.我究竟做错了什么?这是我记录的indexPath

NSLog(@"%@",indexPath);

<NSIndexPath: 0xd2897d0> {length = 2, path = 0 - 0}
<NSIndexPath: 0xd290af0> {length = 2, path = 1 - 0}
<NSIndexPath: 0xd2a5cd0> {length = 2, path = 2 - 0}
<NSIndexPath: 0xd2a8340> {length = 2, path = 3 - 0}
Run Code Online (Sandbox Code Playgroud)

的cellForRowAtIndexPath

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {



    UITableViewCell *cell = nil;


    if (indexPath.row < 3) {
        TextFieldTableViewCell *accountCell = [tableView dequeueReusableCellWithIdentifier: textFieldCellIdentifier forIndexPath: indexPath];
        accountCell.cellTextField.delegate = self;

            accountCell.cellLabel.text = [accountArray objectAtIndex: indexPath.row]; …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

3
推荐指数
1
解决办法
3342
查看次数

标签 统计

ios ×1

objective-c ×1

uitableview ×1