Xcode 6:无法将任何IBOutlet连接到ViewController [英] Xcode 6: can't connect any IBOutlet to ViewController

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

问题描述

升级到Xcode 6之后,我打开了一个旧项目(包含一个子项目,因此它有很多目标)
我注意到我的Storyboard ViewContoller没有链接到相关的对象。

After upgrading to Xcode 6, I opened an old project (that contains a subproject, so it has many targets) and I noticed that no link from my Storyboard ViewContoller to the relative Objects works.

例如我有一个带有TableView的ViewController,现在我无法用它做任何事情,因为缺少连接,我甚至无法重新定义一个新的IBOutlet VC因为来自VC的故事板中的箭头不会连接任何东西。

For example I have a ViewController with a TableView inside and now I cant do can't do anyhing with it because the connection is missing, I can't even redefine a new IBOutlet in the VC because the arrow in the storyboard from the VC won't connect to anything.

更清楚:

该类定义于自定义类部分,所以我找不到问题

The class is defined in the Custom Class section, so I can't find the problem

我该怎么办?
顺便说一下,我使用obj-c并不是很快,我发现了一些相关的答案,但都是关于swift的。

What should I do? Btw I'm using obj-c not swift, I found some related answer but all about swift.

推荐答案

您还可以看到父视图和自定义类之间的链接已损坏(不再可见),这是一个很大的问题。

我实际上正在处理的应用程序存在完全相同的问题,将XCode从5.xxx更新为6.1。对我有用的解决方法是删除每个视图控制器的引用并将它们重新添加到项目...

I had the exact same issue with the app i'm working on actually, updating XCode from 5.xxx to 6.1. The workaround that worked for me was to remove the reference of every view controller and re-add them to the project...

对于面临该问题的每个人,这是(烦人的)技巧:


  • 第1步:选择.h和.m查看控制器文件

  • 第2步:删除这些文件的参考

  • 第3步:将文件重新添加到项目树中

  • 第4步:打开故事板,最终重新构建项目并微笑

  • Step 1 : select both .h and .m view controller files
  • Step 2 : remove the reference of those files
  • Step 3 : re-add the files to your project tree
  • Step 4 : open the storyboard, eventually re-build the project and smile

我能理解那些事情可能会让人感到厌烦,但它对我有用......希望它会帮助别人!

I can understand those things could be reaaally annoying, but it worked for me... Hope it will help someone else !

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

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