【发布时间】:2018-02-26 10:59:28
【问题描述】:
我在使用 XCode 时遇到了一些问题。我正在尝试从 nib 文件中加载单元格,但这很奇怪。如果我清理我的项目,有时一个视图会起作用,然后另一个视图将无法加载,如果我重新清理,它们有时会交换。
Xcode 中是否有一些缓存文件夹或我可以删除的临时文件? SO 上的常见解决方案似乎都不适合我。
2018-02-26 10:51:04.700364+0000 SpiceCentral[73982:3269187] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/james/Library/Developer/CoreSimulator/Devices/2190BB99-8811-437E-B620-3B4F917B391F/data/Containers/Bundle/Application/F83C4BDA-F236-4C22-B95F-6539FB8A8595/SpiceCentral.app> (loaded)' with name 'descTableViewCell''*** First throw call stack:
它试图加载的单元格:
override func viewDidLoad() {
super.viewDidLoad(
tableView.register(UINib(nibName: "descTableViewCell", bundle: nil), forCellReuseIdentifier: "descTableViewCell")
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let descCell = tableView.dequeueReusableCell(withIdentifier: "descTableViewCell", for: indexPath) as! descTableViewCell
return descCell
}
我的 descCell 笔尖文件:
我已经尝试清理我的项目,重新构建。关闭 Xcode,重新启动我的 mac,使用新的模拟器。
谢谢, J
【问题讨论】: