xib错误提示:[UIViewController superview]: unrecognized selector sent to instance

今天学习九宫格应用管理,初次使用xib自定义界面,按照视频的步骤搭建后自定义View后,编译通过但运行时出错,错误提示

[UIViewController superview]: unrecognized selector sent to instance .

在google搜索了一下错误提示,发现一条stackoverflow的回答比较有参考价值。

xib错误提示:[UIViewController superview]: unrecognized selector sent to instance_第1张图片

又看了看自己搭建的自定义View,本来应该拖曳View控件,结果拖曳了ViewController控件。删除重新添加View控件,然后可以正常显示。

xib错误提示:[UIViewController superview]: unrecognized selector sent to instance_第2张图片

你可能感兴趣的:(xib错误提示:[UIViewController superview]: unrecognized selector sent to instance)