IBOutlets 未在 XCode 6.1 (6A1052d) 上显示 [英] IBOutlets not showing on XCode 6.1 (6A1052d)

查看:17
本文介绍了IBOutlets 未在 XCode 6.1 (6A1052d) 上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个相当大的问题:出口没有出现在 IB 中.

This is quite a major problem: the Outlets are not appearing in IB.

复制:

1) 我将一个变量声明为 IBOutlet,例如在我的视图控制器的 .h 文件中

1) I declare a variable to be IBOutlet, for example in my view controller's .h file

@property (nonatomic, strong) IBOutlet UILabel* testlabel;

2) 我打开故事板,点击视图控制器.- 如果这是一个新项目,则没有Outlets"列表.- 如果这是一个已定义网点的旧项目,则网点"列表包含以前的网点,但不包含我添加的网点.

2) I open the storyboard, click on the viewcontroller. - If this is a new project, there is no "Outlets" list. - If this is an old project with outlets already defined, the "Outlets" list contains the previous outlets, but not the one I've added.

有没有人遇到过同样的问题.这真的很重要,因为除非我停止使用 Outlets,否则我基本上无法继续.我在发行说明中找不到任何相关信息.

Has anyone had the same problem. This is really important, as I can't basically proceed unless I stop using Outlets. I can't find any info about it on the release notes.

编辑 我正在 youtube 上添加一个视频来显示问题,以防我没有正确解释.如果我忘记了一些明显的事情,我很高兴被嘲笑:) 也就是说,我一直在遵循这些相同的行为,并且 Outlets 一直在列表中.

EDIT I'm adding a video on youtube showing the problem, in case I haven't explained it properly. If I'm forgetting something obvious, I'm happy to be laughed at :) That said, I've always been following these same actions and Outlets have always been in the list.

EDIT 2 为清楚起见,我删除了 ivar 声明,因为它似乎引起了大部分关注.

EDIT 2 For clarity, I've removed the ivar declaration as it seemed to get most of the attention.

Youtube 上的网点

EDIT 3 好吧,我似乎遇到了之前在 这个问题另一个问题.基本上,如果我打开自定义类下拉菜单,我只会看到一些标准"类,例如 UIViewController.如果我选择其中任何一个,我就会得到 Outlets.例如,对于 UIViewController 我总是有那个视图->视图.但是,我的项目的类不在下拉列表中.手动输入名称似乎有效,但实际上并非如此.一定有一些索引问题(除了我已经从

EDIT 3 Ok I seem to be hitting a problem seen previously on this question and this other question. Basically, if I open the custom class drop-down, I see only some "standard" classes, such as UIViewController. If I select any of these, I get the Outlets. For example, for UIViewController I always have that view->View. However, my project's classes are not in the drop-down. Entering the name manually seems to work, but in fact it's not. There must be some indexing issue (except I've already deleted everything from

~/Library/Developer/Xcode/DerivedData/

没有成功.如果您想尝试,我已将我的代码放在 GitHub 上.这不会为我显示 Outlets,但它会为其他一些人显示 - 所以严格来说这不是代码的错误".这更像是一个 XCode 问题.欢迎任何帮助!

without success. If you wish to try, I've put my code on GitHub. This doesn't show the Outlets for me, but it does for a number of other people - so it's not a "bug" with the code strictly speaking. It's more an XCode issue. Any help would be welcome!

EDIT 4 我认为这就是问题所在,差不多:看右边.下拉菜单不显示ViewController.h"类.如果我手动输入它,它似乎可以识别它,但实际上我怀疑它没有.以前,我总是在下拉菜单中看到我的项目类的完整列表.

EDIT 4 I think here's the problem, pretty much: look on the right. The drop-down menu doesn't show the "ViewController.h" class. If I enter it manually, it seems to recognise it but in fact I suspect it doesn't. In previous times, I was always seeing the full list of my project's classes in the drop-down menu.

推荐答案

我找到了解决方案"或变通方法.删除XCode数据是不够的,仅仅重启是不够的.以下序列使 Outlets 神奇地重新出现并正常工作:

I've found a "solution", or workaround. Deleting the XCode data is not enough, and it's not enough to just restart it. The following sequence makes the Outlets magically re-appear and work properly:

  1. 清理项目
  2. 关闭 XCode
  3. 删除 ~/Library/Developer/Xcode/DerivedData/的所有内容
  4. 重启 MacOs

通过这样做,当您重新打开 XCode 并重新编制索引时,它会按预期显示出口.

By doing this, when you re-open XCode and it reindexes, it will show the outlets as expected.

这篇关于IBOutlets 未在 XCode 6.1 (6A1052d) 上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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