51

In an Xcode project, I see XML when clicking on MainStoryBoard.storyboard instead of the graphical design, why and how to restore the right view ?

Update: I think it's a bug of XCode 4.2 because on another project, when I click on version editor I have XML but when I click on standard editor it shows visual design.

Is there a way to fix this and not to force me to recreate my visual design by hand once again ?

user310291
  • 36,946
  • 82
  • 271
  • 487

7 Answers7

111

To fix the issue, right-click MainStoryboard.storyboard, then choose "Open as >" and then "Interface Builder - iOS Storyboard".

Bart
  • 19,692
  • 7
  • 68
  • 77
Jonathan
  • 1,126
  • 1
  • 7
  • 2
30

Make sure you are not using the source control editor, which shows you the changes for a given file. You can change this in the Toolbar at the top right.

Check this link in the section "Editor"

version-editor

Community
  • 1
  • 1
Besi
  • 22,579
  • 24
  • 131
  • 223
  • There are 3 icons in Editor bar: I tried standard editor and assistant editor but still have xml. Is it what you mean ? Thanks for help. – user310291 Feb 27 '12 at 13:43
  • Update: I think it's a bug of XCode 4.2 because on another project, when I click on version editor I have XML but when I click on standard editor it shows visual design. Is there a way to fix this and not to force me to recreate my visual design by hand once again ? – user310291 Feb 27 '12 at 15:35
  • yes that's the one I meant. what you can do is to add a new storyboard via "File > New File" with another name and then insert the xml content of your current storyboard, then in project settings set this new storyboard as the initial storyboard. – Besi Feb 27 '12 at 21:57
16

This worked for me using xcode 6 enter image description here

Edwin O.
  • 4,998
  • 41
  • 44
4

I've run into this issue, but it was a bit different. I had a merge issue with Git on my storyboard, so I had to manually edit the XML to resolve the conflict. After this, there was no 'Interface Builder-iOS Storyboard' option available in the "Open as" menu so I couldn't change it back to the visual editor. To fix this I simply restarted XCode and everything went back to normal.

SeanK
  • 667
  • 7
  • 16
4

After using SeanK's solution (restart XCode) I still manually needed to right-click the storyboard and choose Open as > Interface Builder - iOS Storyboard.

piersb
  • 609
  • 9
  • 22
0

If you have more than just one storyboard go back and forth - click different one, go back to the one you want to display as an iOS storyboard. It's not XML any longer.

Viktor Kucera
  • 6,177
  • 4
  • 32
  • 43
0

Change the extension like this "your_storyboard.storyboard" then right-click MainStoryboard.storyboard, then choose "Open as >" and then "Interface Builder - iOS Storyboard".

Dalal Alharbi
  • 181
  • 1
  • 11