macOS Loaded the "XXXX" nib but no view was set.

NSViewController 从 xib 加载 view 时出现错误:

macOS: Loaded the "XXXX" nib but no view was set.

iOS :loaded the "XXXView" nib but the view outlet was not set

没有做nib文件到xxxViewControler程序的关联,特此记录下来:

1, 打开nib文件

2, 点击"File's Owner",设置Class为xxxViewControler

3, 按Control+"Files's Owner", 里面有个默认的IBOutlet变量view, 看一下后面有没有做关联,如果没有就拉到下面的View和视图做个关联

猜你喜欢

转载自blog.csdn.net/ZhangWangYang/article/details/82895163