本文介绍了Xcode Interface Builder - “正确”删除/重命名错误连接的IBoutlets / IBactions的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Xcode的新手,通过Swift工作,所以我不确定我所描述的是否真的是一个bug。

I am new to Xcode, working through Swift, so I'm not sure if what I am decribing is actually a bug.

使用界面构建器时助理编辑器,我可以创建标签,按钮等,并使用control-drag在代码中创建Outlets和Action。

When using interface builder and the assistant editor, I can create lables, buttons etc, and create Outlets and Action in the code with a control-drag.

只要我很完美,没问题。但是,如果我误解了对象名称,我似乎遇到了问题。或者,我选择出口而不是行动。我似乎无法找到一种方法来进行修正,似乎并没有完全弄乱IDE。即使我删除了IB中的对象和代码,但在构建时似乎也会留下问题。或者,如果我尝试删除代码中的行并重新拖动它,则会创建一行新代码,但该对象现在似乎引用了新名称,以及旧的,现在缺少的名称。

So long as I am perfect, no problem. But I seem to run into problems if, for example, I make a mispelling of the object name. Or, I choose outlet instead of action. I can't seem to find a way to make a correction that does't seem to totally screw up the IDE. Even if I delete the object in the IB and the code, it seems to leave problems behind when I build. Or, if I try to delete the line in code and re-drag it, a new line of code is created, but the object seems to now reference the new name, and the old, now missing name.

再次,我正在使用Swift ---因为我不使用/知道Objective-C我不知道是否有使用该语言的类似行为。

Again, I am working with Swift --- Since I don't use/know Objective-C I don't know if there is a similar behavior using that language.

感谢任何指针。 (除了不使用Interface builder / storyboards / Swift。)

Appreciate any pointers. (Other than don't use the Interface builder / storyboards / Swift.)

推荐答案

使用Connections检查器断开连接。然后你可以修改/删除对象和/或代码而不必担心。

Use the Connections inspector to break the connection. Then you can modify/delete the object and/or the code without having to worry.

这篇关于Xcode Interface Builder - “正确”删除/重命名错误连接的IBoutlets / IBactions的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-28 03:45