无法链接到 XCode9 中的插座集合 [英] Can't link to outlet collection in XCode9

查看:27
本文介绍了无法链接到 XCode9 中的插座集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些限制,可以在动画过程中随机播放.升级到 XCode9 后,我尝试进行一些调整,编辑器似乎不再允许我向约束集合 IBOutlet 添加约束.我什至创建了一个新项目并尝试制作一个简单的插座系列并遇到了同样的问题.这是我正在谈论的内容的简短视频:

I have some constraints that a shuffle around during an animation. After upgrading to XCode9 I tried to make some tweaks, and the editor seems to no longer allow me to add constraints to an constraint collection IBOutlet. I even created a new project and tried to make a simple outlet collection and ran into the same issue. Here's a short video of what I'm talking about:

我已经尝试过删除派生数据、重新启动 xcode、创建新的 xib、向 xcode 神灵祈祷等通常的事情.正如您在 gif 中所见,它甚至发生在我的一个全新项目中.还有人看到这个吗?我缺少任何解决方法?

I've tried the usual things of deleting derived data, restarting xcode, creating new xibs, praying to the xcode gods...etc. As you can see in the gif, it even happens to me in a brand new project. Anybody else seeing this? Any work-around I'm missing?

我认为这是一个合法的错误,我提交给了苹果.

I think this is a legit bug, I submitted it to apple.

我很惊讶我没有看到其他人遇到这个问题.

I'm surprised I don't see anybody else running into this.

推荐答案

我遇到了同样的问题.这是我能找到的让它工作的唯一解决方法是在代码中创建 Outlet Collection(或者在你做的时候通过从情节提要中拖动来创建第一个).然后从 ViewController 的行边距中的添加"图标拖回到故事板上的对象,而不是通常的方式.

I had the same issue. This is the only workaround I could find to get it working is to create the Outlet Collection in code (or create the first one by dragging from the storyboard as you're doing). Then drag from the 'add' icon in the ViewController's line margin back to the objects on the storyboard rather than the usual way around.

这似乎也是一种替代方式:https://stackoverflow.com/a/45597939/1320134

This also seems to be an alternative way: https://stackoverflow.com/a/45597939/1320134

总而言之,您需要像当前一样创建第一个插座集合,然后从连接检查器中新创建的引用插座集合"拖动到要添加到故事板中的集合的其他对象.

In summary, you need create the first outlet collection as you are currently doing, then drag from the newly created 'referencing outlet collection' in the Connections Inspector to the other objects you want to add to the collection in the storyboard.

这篇关于无法链接到 XCode9 中的插座集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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