简体   繁体   English

无法在表视图控制器中为单元格设置自定义类

[英]Can't set custom class for cell in table view controller

I'm really going crazy: I can't simply set my custom class for a UITableViewCell and I really don't know why. 我真的很疯狂: 我不能简单地为UITableViewCell设置自定义类 ,我真的不知道为什么。

My project 我的项目

在此输入图像描述

In my Storyboard I have a table view controller set to use ManageListsTVC.swift . 在我的Storyboard中,我有一个表视图控制器设置为使用ManageListsTVC.swift

I want use a custom cell with dynamic prototypes so I create a custom class ListTVCell : 我想使用带有动态原型的自定义单元格 ,因此我创建了一个自定义类ListTVCell

import UIKit

class ListTVCell: UITableViewCell
{

    override func awakeFromNib()
    {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool)
    {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
}

So, clean, build, go in IB, select my table view controller, select the cell and... 所以,清理,构建,进入IB,选择我的表视图控制器,选择单元格和...

在此输入图像描述

I can't see my custom class! 我看不到我的自定义课程! Why? 为什么? Really, I waste so much time already for this stupid problem and I don't know what's wrong. 真的,我已经为这个愚蠢的问题浪费了这么多时间,我不知道出了什么问题。

What I already tried 我已经尝试过了什么

  • empty cache in ~/Library/Developer/Xcode/DerivedData 〜/ Library / Developer / Xcode / DerivedData中的空缓存
  • restart Xcode 重启Xcode
  • clean project 干净的项目
  • check if ListTVCell.swift appears in compiled sources 检查ListTVCell.swift是否出现在已编译的源中

I'm using Xcode 6.3.1. 我正在使用Xcode 6.3.1。

--> incredibly after a complete reboot of my Mac now everything works and I can set my custom class. - > 完全重启我的Mac之后,现在一切正常,我可以设置我的自定义类。

Really strange but I decide to reply to my post, maybe can be helpful for someone else. 真的很奇怪,但我决定回复我的帖子,也许对别人有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将内容添加到IB中的视图控制器中的自定义表视图单元格 - can't add content to custom table view cell in view controller in IB 如何从Custom Table View Cell类获取对Table View Controller的引用 - How to get a reference to Table View Controller from Custom Table View Cell class 无法在UI表格视图自定义单元格中创建分隔符插入 - Can't make seperator insets in UI table view custom cell 自定义单元格无法在iOS 6的表格视图中显示 - Custom Cell can't display in Table view in ios 6 无法在自定义表格视图单元格中使ImageView成为圆圈 - Can't make ImageView a circle in a Custom Table View Cell 如何根据表视图单元格的详细文本标签,将segue设置为与表视图控制器不同的视图控制器? - How can I set a segue to a different view controller from a table view controller, based on the detail text label of the table view cell? 无法将自定义类分配给Page View Controller - Can't assign custom class to Page View Controller 无法在自定义表格视图单元格上设置属性 - Cannot set properties on custom table view cell 自定义类的表视图单元格返回nil - table view cell of custom class returning nil 选择表格视图单元格时无法推送视图控制器 - Can't push my view controller when I select a table view cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM