在ios 9.1或9.0模拟器上运行时,空白单元格在8.4模拟器上运行正常

在ios 9.1或9.0模拟器上运行时,空白单元格在8.4模拟器上运行正常,ios,objective-c,xcode,uitableview,Ios,Objective C,Xcode,Uitableview,在ios模拟器9.1或9.0上运行我的应用程序时,单元格为空白,xcode显示无错误。在8.4模拟器上运行良好。代码没有变化 我试过以下方法 已删除情节提要中的自定义单元并重新创建它。没用 更改了标识符和文件名。没用 从项目中删除自定义cell.h文件,然后将其重新添加。没用 在tableView可见后,重新加载数据。没用 断开连接,然后在情节提要中重新连接tableView委托和数据源。没用 使用默认的customCell.textlab.text=[\u nameArray objectA

在ios模拟器9.1或9.0上运行我的应用程序时,单元格为空白,xcode显示无错误。在8.4模拟器上运行良好。代码没有变化

我试过以下方法

  • 已删除情节提要中的自定义单元并重新创建它。没用
  • 更改了标识符和文件名。没用
  • 从项目中删除自定义cell.h文件,然后将其重新添加。没用
  • 在tableView可见后,重新加载数据。没用
  • 断开连接,然后在情节提要中重新连接tableView委托和数据源。没用
  • 使用默认的
    customCell.textlab.text=[\u nameArray objectAtIndex:indexPath.section]
    和imageView
    customCell.imageView.image=[\u profileImageArray objectAtIndex:indexPath.section]自定义单元格中的属性。工作正常,但这没有帮助,因为我想使用自定义对象
  • 硬编码的customName、customTime和customImage<代码>customCell.customName.text=@“嗨”
    customCell.customImage.image=[UIImage ImageName:@“commentButton.png”]。没用
  • 我向datasource方法添加了断点,并执行了所有断点
  • 我使用NSLog查看我的customCell是否为零。我从日志
    中得到以下响应
  • 在cellForRowAtIndexPath中设置值之前,我记录了名称标签,它记录了故事板中设置的内容
  • 我在代码/情节提要中搜索隐藏的命令,没有设置为隐藏 选中“使用大小类”复选框,我已将大小设置为“wCompact hAny”

    在viewcontroller.m中找到CellForRowatineXpath的我的代码

        static NSString *simpleTableIdentifier = @"messagePreviewCell";
    
        messagePreviewCell *customCell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    
        customCell.customName.text = [_nameArray objectAtIndex:indexPath.section];
        customCell.customTime.text = [_timeArray objectAtIndex:indexPath.section];
        customCell.customDescription.text = [_messageArray objectAtIndex:indexPath.section];
    
        NSString *className = [[[_profileImageArray objectAtIndex:indexPath.section] class] description];
    
        if ([className isEqualToString:@"UIImage"]) {
            customCell.customImage.image = [_profileImageArray objectAtIndex:indexPath.section];
        }
    
        return customCell;
    

    我的代码运行良好…请帮助,谢谢

    如果您只为一个设备系列开发,请在情节提要的文件检查器中取消选中“使用大小类”

    在这里找到我的答案(其他信息)!

    如果对标签文本进行硬编码,单元格是否仍为空?例如:
    customCell.customName.text=@“你好”检查数据源//\u nameArray或\u timeArray。。在标签上进行硬编码是否将customName/customType/customDescription标签从情节提要连接(创建IBOutlets)到代码中?此时最好在一些数据源方法中添加断点。然后检查:1。有人打电话给他们吗。2.是要退出队列的单元格,为零。3.您的
    nameArray
    timeArray
    messageArray
    是否为零?4.单元格上的标签是否为零。5.单元格上的任何内容是否通过不透明度或隐藏属性隐藏。是否使用大小类?