无法将IBOutlets连接到Storyboard [英] Unable to connect IBOutlets to Storyboards

查看:133
本文介绍了无法将IBOutlets连接到Storyboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用故事板为我的iPad应用程序创建iPhone界面,我已将项目更改为Universal而不是iPad,并在项目摘要屏幕中将所需的故事板分配给其设备。
但是当我尝试使用control + drag将任何元素连接到一段代码时,例如:

I've recently started creating an iPhone interface for my iPad application using storyboards, I've changed the project to Universal instead of iPad and assigned the desired storyboard to its device in the project summary screen. But when I try to connect any element using control+drag to a piece of code such as:

@property (strong, nonatomic) IBOutlet UIImageView *logo;

它无法链接它。对象与代码所说的类型相同,与View是同一类继承相同。 iPad故事板仍然运行良好,可以增强,它仍然与项目相关联。新的iPhone故事板是完全无用的,为什么会这样?

It just can't link it. The object IS the same type as the code says, same as the View is the same class inheritance. The iPad storyboard is still working well and can be enhanced, it's still linked to the project. The new iPhone storyboard is completely useless, why is that?

推荐答案

当故事板中的视图控制器为场景发生时会发生这种情况正在进行的工作没有设置为正确的等级。

This happens when the view controller in the storyboard for the scene you are working on is not set to the correct class.

以下是它的外观:

这篇关于无法将IBOutlets连接到Storyboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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