加载了笔尖文件,但未设置视图出口 [英] Loaded the nib file but the view outlet was not set

查看:60
本文介绍了加载了笔尖文件,但未设置视图出口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意外删除了universityPicker.xib,然后使用相同的名称创建了一个新的文件,但无法建立连接.文件崩溃并显示此消息

I deleted the universityPicker.xib accidentally and then made a new one with the same name but no connection could be done. The file crashes and gives this message

reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "universityPicker" nib but the view outlet was not set."

我该如何解决?

推荐答案

  • 打开universityPicker.XIB文件
    • 单击左侧栏中文件的所有者图标
    • 点击右侧栏中的第三个标签
    • 在顶部的自定义类"下,确保类"是应与此视图相对应的ViewController的名称.如果没有,请输入
    • 在右侧栏中,单击最后一个标签
    • 您应该看到下面带有视图"的插座".将其旁边的圆圈拖到左侧栏上的查看"图标
    • 保存xib并重新运行
      • Open the universityPicker.XIB file
        • Click on file's owner icon on the left bar
        • Click on the third tab in the right-hand sidebar
        • Under "Custom Class" at the top, make sure Class is the name of the ViewController that should correspond to this view. If not, enter it
        • In the right-hand sidebar, click on the last tab
        • You should see "outlets" with "view" under it. Drag the circle next to it over to the "view" icon on the left bar
        • Save the xib and re-run
        • 这篇关于加载了笔尖文件,但未设置视图出口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆