为什么它是UIView而不是UIViewController的子类xib中的UIViewController?
问题描述:
当我新创建UIViewController
的子视图以及xib
文件时,我发现它是而不是xib
文件中的UIViewController
。
那么为什么Xcode像这样实现xib文件呢?什么目的?为什么它是UIView而不是UIViewController的子类xib中的UIViewController?
新创建的类: -
的厦门国际银行文件: -
我知道,使视图与''NewViewController's'连接self.view'。现在你了。 –
你说得对。 Xcode链接了视图,文件所有者和NewVIewController类。但是这样,它总是会导致一些bug。所以每次我都会删除文件所有者的“身份检查器”中的视图和“NewViewController”名称,并且自己拖动一个新的UIViewController,并在UIViewController的“NewVIewController”中填写身份检查员。这很烦人。 –
您不能在'XIB'内添加'UIViewController',您需要添加'UIView'并将其与FIle的所有者视图连接起来。 –