Xcode:标识符 IBMemberID xxx-xx-xxx 已被 <IBUITableView: 0x7fc17df3b720> 使用. [英] Xcode:The identifier IBMemberID xxx-xx-xxx is already in use by <IBUITableView: 0x7fc17df3b720>

查看:26
本文介绍了Xcode:标识符 IBMemberID xxx-xx-xxx 已被 <IBUITableView: 0x7fc17df3b720> 使用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我修复 MainStoryboard.storyboard 中的一些冲突后,Xcode 出现构建错误:

After i fixed some conflicts in MainStoryboard.storyboard, Xcode occured build error:

Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 255
ibtoold[26299:507] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-5056/InterfaceBuilderKit/Document/IBObjectContainer.m:363
Details:  The identifier '<IBMemberID: 6mN-WX-Cqa>' is already in use by <IBUITableView: 0x7fc17df3b720>
Object:   <IBObjectContainer: 0x7fc17ac1d920>
Method:   -validatedIdentifier:
Thread:   <NSThread: 0x7fc17ad19b30>{name = (null), num = 1}
Hints: None

我在 stackoverflow 上发现了许多类似的问题,但对我不起作用,包括:

I found many similar questions at stackoverflow, but not working for me, includes:

Clean project
Delete Derived Data
Restart Xcode

我想找到 IBMemberID: 6mN-WX-Cqa 所在的确切行,但似乎很难.

I want to find exact line which IBMemberID: 6mN-WX-Cqa is in, but seems difficult.

提前致谢!

推荐答案

Xcode:The identifier IBMemberID xxx-xx-xxx is already in use by

问题的原因

我遇到了同样的问题.对我来说,这是在从一个 Git 分支合并到主分支之后,当试图查看 StoryBoard 时,XCode 卡住了,然后它意外退出了.然后我搜索了一下,然后,我在上面的答案中从@Vijayts 那里得到了提示.但因此,走出去的一步就不同了.

Xcode:The identifier IBMemberID xxx-xx-xxx is already in use by

Cause of the Problem

I had the same problem. For me it was just after merging from one Git Branch to the Master Branch, and when tried to view the StoryBoard, XCode got stuck and then it quit unexpectedly. Then I searched a bit and then, I got the hint from @Vijayts in the above answer. But hence one step out of it is different.

  1. 查看与 bug 相关的 StoryBoard(某些项目可能有多个 Storyboard)作为源代码,右键单击它 > Open As > Source Code.

  1. View the StoryBoard relevant to the bug, (some projects may have more than one storyboard) as source code, by right click on it > Open As > Source Code.

把ID复制出来,
IBMemberID:6mN-WX-Cqa
这是 6mN-WX-Cqa 部分.

Copy the ID out of,
IBMemberID: 6mN-WX-Cqa
which is the 6mN-WX-Cqa part.

搜索该 ID.当然,它可能已经复制,很可能在 StoryBoard 源代码中的两个位置.该 ID 用于 UI 元素.可能是按钮、标签或文本字段,甚至是 UIImageView 等.

Search for that ID. For sure it may have been duplicated, most probably in two locations within the StoryBoard Source code. That ID is for an UI Element. May be a button, label or a textfield or even a UIImageView, etc.

从重复的元素中确定,要保留哪个元素,应该删除哪个元素.您可以通过元素的属性来识别元素,例如 x、y、宽度、高度、文本、颜色等.如果您能首先识别出使用相同 IBMemberID 但具有不同属性值的重复项,则会更容易.

Decide out of the duplicated elements, which element to keep and which element is you should delete. You can Identify the elements by their attributes like, x, y, width, height, text, color like things. It's easier if you can identify it at first which has been duplicated with the same IBMemberID but with different attribute values.

您在界面生成器中添加的这些元素现在显示为 XML 元素,因为它处于源代码模式.所以要小心地删除整个不需要的(重复的)XML 元素.起初我也害怕删除这些 XML 元素.但是将这些 ID 更改为唯一的不适合我.

These elements you added in the Interface Builder, are now shown as XML elements as it's in source code mode. So be careful to delete the whole unwanted(duplicated) XML element. At first I was also afraid to delete these XML elements. But changing those IDs to be unique was not fit for me.

然后清理项目并尝试构建它.很可能它会构建失败.这是因为可能发生了相同类型的错误,但使用了新的 IBMemberID.重复相同的过程,直到可以成功完成构建.

Then clean the project and try building it. Most probably it will fail to build. That's because of the same kind of error may have occurred but with a new IBMemberID. Repeat the same process until the Build can be done successfully.

完成所有这些之后,现在我可以在 Interface Builder 中很好地查看 StoryBoard.

After all of these, now I can view the StoryBoard in Interface Builder finely.

所以最后希望这个答案可以节省一些宝贵的地球工时,希望不要浪费你的阅读时间.

So finally hope this answer may save some valuable Earthly Man Hours and hope not it's wasted your time for reading.

干杯!

这篇关于Xcode:标识符 IBMemberID xxx-xx-xxx 已被 &lt;IBUITableView: 0x7fc17df3b720&gt; 使用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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