Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode:The identifier IBMemberID xxx-xx-xxx is already in use by <IBUITableView: 0x7fc17df3b720>

Tags:

xcode

ios

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

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

Clean project
Delete Derived Data
Restart Xcode

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

Thanks in advance!

like image 606
Allen Avatar asked Aug 19 '14 07:08

Allen


2 Answers

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.

To Resolve The Problem:

  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.

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

  3. 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.

  4. 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.

  5. 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.

  6. 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.

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.

Cheers!

like image 119
Randika Vishman Avatar answered Nov 06 '22 08:11

Randika Vishman


1) Right click on your Storyboard file in Xcode's project explorer and choose "Open as -> Source code".

2) Search for duplicate identifier ("6mN-WX-Cqa" in your case). There will two or more occurrences of it as the id of your UI elements. (Was a UIButton and a UILabel in my case).

3) Manually change the value of one of these ids to make sure it's unique.

Save and Build your Project.

like image 6
Vijay Tholpadi Avatar answered Nov 06 '22 06:11

Vijay Tholpadi