Xcode 6中的错误 - 视图控制器没有名为(子视图)的插座 [英] Error in Xcode 6 - view controller does not have an outlet named (subview)

查看:147
本文介绍了Xcode 6中的错误 - 视图控制器没有名为(子视图)的插座的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的某个应用中遇到此错误,在检查了其他一些应用后,发生了同样的错误。我的 IBOutlets IBActions 都不再连接。当我通过控制 - 拖动到.h 文件重新创建插座时,插座仍会在 Connections Inspector> Outlets 中显示错误,说(视图控制器)没有出口名称(子视图)。在今天之前我没有遇到这个问题,那么与Xcode 6有关吗?视图控制器引用 Identity Inspector> Custom Class 下的正确类。我删除了派生数据文件夹,删除了对.h文件的引用,清理了项目,并清理了构建文件夹。在修复此问题之前,这些都没有用,我无法继续开发。

I just got this error in one of my apps, and after checking some other apps the same error is happening. None of my IBOutlets and IBActions are connected anymore. When I recreate the outlet by control-dragging into the .h file, the outlet still displays the error in Connections Inspector > Outlets, saying (view controller) does not have an outlet named (subview). Before today I didn't have this problem, so is to do with Xcode 6? The view controller is referencing the correct class under Identity Inspector > Custom Class. I have deleted the derived data folder, removed the reference to the .h file, cleaned the project, and cleaned the build folder. None of that has worked and I can't progress with development until this issue is fixed.

更新:几天后我才重新打开这个项目,我的网点旁边不再有感叹号了,我断开连接的'easyLabel'插座又重新出现了。我没有改变任何东西,所以我猜这是Xcode 6-6.1中的一个错误。

更新2:此错误又回来了。每个插座旁边都有惊叹号。如果我删除它们,我无法重新添加它们。无法创建新的网点。也不能给视图控制器一个自定义类。我真的只想在应用程序上取得一些进展,但这个问题不断出现。真的好不能再忍受了。任何帮助将不胜感激。

推荐答案

重复: XCode 6:无法将任何IBOutlet连接到ViewController ,但这里有诀窍:

Duplicate of : XCode 6: can't connect any IBOutlet to ViewController but here's the trick :

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

我和我正在处理的应用程序存在完全相同的问题,将XCode从5.xxx更新为6.1。对我有用的解决方法是删除每个视图控制器的引用并将它们重新添加到项目中......不幸的是,在某些情况下,实际上,当XCode关闭时,所有连接都会再次丢失。

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... Unfortunately, in some cases, mine actually, all the connections get lost again when XCode is closed.

面对这个问题的每个人,这里都是(讨厌的)伎俩:


  • 第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中的错误 - 视图控制器没有名为(子视图)的插座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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