故事板 viewcontroller 的自定义 class 设置为没有 xib 的 viewcontroller 显示黑色

Storyboard viewcontroller's custom class set as a viewcontroller without xib shows black

我正在更新我们的应用程序以开始使用故事板。 我的故事板中有一个 ViewController 和自定义 class。自定义 class 指向没有笔尖的 ViewController。然而它的 parent class 确实有一个笔尖。这最终导致设备出现黑屏。即使我删除了大部分代码。

如果我改为在故事板中使用 parent class,它可以正常加载。这就像故事板无法找到 child class 的笔尖。

有人知道问题出在哪里吗?

您不能在 Storyboard 中创建 ViewController,它是 ViewController 的子类,后者加载了 nib。那将是一个 ViewController.

的 2 个界面文件(nib + 故事板)