未设置自定义UIView iboutlet [英] Custom UIView iboutlet not set

查看:60
本文介绍了未设置自定义UIView iboutlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为"abc"的自定义UIView类和一个笔尖.在那个笔尖的IB中创建了一个UIButton.现在,当我尝试通过将箭头扩展到File's Owner来创建该UIButton的出口时,它将不允许我这样做.请告诉我我在做什么错

I have created a custom UIView class named "abc" and a nib with it. Created a UIButton in IB in that nib. Now when I try to create outlet of that UIButton by extending arrow to File's Owner it wont allow me to do so. Please tell What i am doing wrong

推荐答案

问题可能是您没有在xib文件中设置"abc"的自定义类名称.当您创建UIView的子类时,请不要这样.您必须将其视图与该类绑定.当您要建立IBOutlet连接而不是将其连接到文件的所有者时,必须将其连接到放置在对象中的视图(对象列表在界面生成器的左侧).

Problem might be you are not setting Custom Class name for "abc" in xib file. Please not that whenever you create a subclass of UIView. You have to bind its view with that class. And when you are going to make IBOutlet connection instead of connecting it to File's Owner you have to connect it to you View placed in Objects(object list is on left side in interface builder).

这篇关于未设置自定义UIView iboutlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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