简体   繁体   English

Swift:不小心将插座添加到两个不同的文件中,删除了两个插座

[英]Swift: accidentally added an outlet to two different files, deleted both outlets

I accidentally created two outlets for the same UI element and, after realizing the issue, went on to delete both outlets from the code and the element (a label) that they were attached to. 我不小心为同一UI元素创建了两个出口,意识到这一问题后,继续从代码和它们所附加的元素(标签)中删除了这两个出口。

Now I'm still getting the "The [name of outlet] outlet from the [view controller] to the UILabel is invalid. Outlets cannot be connected to repeating content." 现在,我仍然收到“从[视图控制器]到UILabel的[插座名称]插座无效。插座无法连接到重复内容。”

I deleted the code that created the outlet and the element itself with just select+delete. 我仅使用select + delete删除了创建出口和元素本身的代码。 Is there some other way I should have handled it and how can I fix it now? 我还有其他方法可以处理它,现在如何解决?

Delete the outlets that may be causing the problem and control - click on the object in the storyboard and delete all of the connections using the x. 删除可能导致问题并控制的出口-单击情节提要中的对象,然后使用x删除所有连接。 Now, go back and reconnect the outlets and everything should work! 现在,返回并重新连接插座,一切正常!

If you need help, check this out. 如果您需要帮助,请查看此内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM