4

I use bitbucket. It was working fine but from yesterday after commit , push and pull we can not open the storyboard , it shows me ----"Main.storyboard" could not be opened. Multiple elements have the ID "Dsa-PS-aBW"

Can anyone tell me how can I solve this problem?? Or how can I get back my previous code??

  • 2
    Just check out the older commit which worked fine. If you open the storyboard file with editor, you'll find that all object has its own id value(which must be unique). I'm not sure that you can change the value by yourself but worth to try changing value before you check out older commit. – Ryan Jul 08 '15 at 04:17

3 Answers3

3

The longer response in the below question thoroughly explains exactly how to resolve the duplicate id.

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

Storyboard merge conflicts is a small issue with XCode. There's a few blogs offering strategies if you search it.

With regards to getting back your previous code, if you haven't committed yet, you can do the following in XCode:

Source Control > Discard All Changes

If you have committed or if XCode still complains after discarding changes, you can check out your last commit. You can get the 7-digit hash for that commit through terminal with:

$ git reflog

then checkout that commit just like any branch with:

$ git checkout [7-digit hash]    

Example:

$ git checkout a2c4e6g

You'll be in a detached-head state, but no prob. Read this: Git create branch where detached HEAD is

Community
  • 1
  • 1
mxs
  • 615
  • 6
  • 17
2

Right click on the xib or storyboard and then open as Source Code. Then search with your ID (for your case it's “Dsa-PS-aBW”), you should see 2 references, just delete any of them. This will help you fix the issue without discarding anything.

RK Sarker
  • 21
  • 1
  • 3
0

I solved this issue like that

Open your storyboard or xib that has issue as a Source Code and search for ID (for example "Dsa-PS-aBW")

You should have at least two of it and delete the others

Tolga İskender
  • 158
  • 2
  • 14