无法为 table 视图控制器中的单元格设置自定义 class
Can't set custom class for cell in table view controller
我真的要疯了:我不能简单地为 UITableViewCell 设置我的自定义 class,我真的不知道为什么。
我的项目
在我的 故事板 中,我有一个 table 视图控制器 设置为使用 ManageListsTVC.swift。
我想将 自定义单元格 与动态原型一起使用,所以我创建了一个自定义 class 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
}
}
所以,清理、构建、进入 IB,select 我的 table 视图控制器,select 单元格和...
我看不到我的自定义 class!为什么?真的,我已经为这个愚蠢的问题浪费了很多时间,我不知道出了什么问题。
我已经尝试过的
- ~/Library/Developer/Xcode/DerivedData
中的空缓存
- 重启Xcode
- 清理项目
- 检查 ListTVCell.swift 是否出现在编译源中
我正在使用 Xcode 6.3.1.
--> 在 完全重启我的 Mac 之后令人难以置信,现在一切正常,我可以设置我的自定义 class。
真的很奇怪,但我决定回复我的 post,也许对其他人有帮助。
我真的要疯了:我不能简单地为 UITableViewCell 设置我的自定义 class,我真的不知道为什么。
我的项目
在我的 故事板 中,我有一个 table 视图控制器 设置为使用 ManageListsTVC.swift。
我想将 自定义单元格 与动态原型一起使用,所以我创建了一个自定义 class 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
}
}
所以,清理、构建、进入 IB,select 我的 table 视图控制器,select 单元格和...
我看不到我的自定义 class!为什么?真的,我已经为这个愚蠢的问题浪费了很多时间,我不知道出了什么问题。
我已经尝试过的
- ~/Library/Developer/Xcode/DerivedData 中的空缓存
- 重启Xcode
- 清理项目
- 检查 ListTVCell.swift 是否出现在编译源中
我正在使用 Xcode 6.3.1.
--> 在 完全重启我的 Mac 之后令人难以置信,现在一切正常,我可以设置我的自定义 class。
真的很奇怪,但我决定回复我的 post,也许对其他人有帮助。