16

I just downloaded the Xcode 6 GM and every time I select the main storyboard (and a specific xib) Xcode crashes.

The error to be sent to Apple contains the following info

ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-6238/InterfaceBuilder/Documents/IBCocoaTouchPlatform.m:531 Details: Returned status computation result is not an IBMarshallingResult, it's {

Anyone experiencing the same problem?

shim
  • 9,289
  • 12
  • 69
  • 108
abinop
  • 3,153
  • 5
  • 32
  • 46

13 Answers13

23

I've heard that it could be an autolayout problem, so I tried to disable it manually and it worked!

If you right click on the storyboard file, open as source code, and REMOVE the useAutolayout="YES", then clean, rebuild, you should be able to open with no problems.

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Edgar
  • 1,097
  • 1
  • 15
  • 25
  • This worked for me as well thanks @Edgar Rocha Carvalho. – Manolo Sep 28 '14 at 20:02
  • actually the exact one should be removed is useAutolayout="YES" :) – tong Oct 16 '14 at 10:31
  • Worked for me, thanks. 1- Right clicked storyboard file 2- Clicked the open as source code option 3- Found useAutolayout="YES" and changed it to NO Done – fs_tigre Oct 19 '14 at 00:42
  • 8
    Hi All - this answer does work.. But doesn't it create some crazy problem with removing AutoLayout.. how would we then use Xcode for creating adaptive UIs, etc? Unless, you turn it off, launch Xcode, get the storyboard to work and then turn it on again? (Turn it to Yes)? – amitsbajaj Oct 20 '14 at 11:17
  • This problem was driving me crazy and I did not want to turn Auto-layout off since I am planning on using it. Finally I clicked to "add missing constraints". It is no longer crashing. – Ryan Caskey Feb 17 '15 at 00:45
15

This was causing me a ton of trouble, and re-creating the storyboard wasn't an option. I got past it by ctrl/right clicking on the storyboard and doing

"Open As" > "Source Code"

I then made a small change, undid it and re-saved the file. Then I did

"Open As" > "Interface Builder - Storyboard"

It opened without crashing Xcode.

shim
  • 9,289
  • 12
  • 69
  • 108
averydev
  • 5,717
  • 2
  • 35
  • 35
  • 3
    This is beautiful! This should be the accepted answer! – Ravi Nov 03 '14 at 08:24
  • It also worked for me but I have to do it regularly when opening my main storyboard make XC crashing. So this answer is not a long term fix for me :-/ – Maxime T Dec 06 '14 at 17:39
  • It worked for me for Xcode 7.1 on Mac OS X 10.11.1 and there is no more crash by adding a character, saving, undoing and saving in source code mode and then back to visual mode. – zeeawan Oct 30 '15 at 03:00
  • Another crash got resolved a different way so I'm going to add as a separate answer down here. – zeeawan Nov 03 '15 at 20:39
8

To fix this problem:

  1. open a Finder window and navigate to your project
  2. right-click on the .xcodeproj file (it’s a package actually)
  3. select Show Package Contents
  4. a new window appears
  5. delete a folder called xcuserdata

How to avoid this in the future: once added to .gitignore, you must issue the following command:

git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/yourUserName.xcuserdatad/UserInterfaceState.xcuserstate

git commit -m "Removing file thats driving me insane"
Ricardo Anjos
  • 1,417
  • 18
  • 22
3

(1) Have you cleaned and rebuilt the project?

(2) Have you tried to empty the xcuserdata folder? The folder contains ui states and can be the reason for such an issue, especially when xcode was updated. The xcuserdata folder can be found in your project directory when you right-click your .xcodeproj "file" and select "show package content". Close Xcode, empty the xcuserdata folder and reopen the .xcodeproj file.

Hope one of these helps :)

Eike
  • 620
  • 4
  • 6
  • Found another problem cause here: http://stackoverflow.com/questions/9109571/xcode-wont-compile-ios-apps-crashes-when-xib-or-storyboard-files-are-opened?rq=1 If you use TotalFinder, this might be the problem. – Eike Sep 17 '14 at 12:46
  • Deleting the .xcuserdata folder worked for me—was only having this crash issue when viewing a storyboard; not a xib. – Evan R Sep 29 '14 at 15:45
  • Cleaning xcuserdata seems to work long term for me. This problem was often occurring since I changed the name of my iOS app. – Maxime T Dec 06 '14 at 18:44
1

If people are using multiple tabs that might be an issue. My Xcode 6.0.1 was becoming unresponsive whenever the same storyboard was opened in more than one tab...

shim
  • 9,289
  • 12
  • 69
  • 108
akiraspeirs
  • 2,127
  • 2
  • 21
  • 29
0

Was this from an earlier version of Xcode, or was it from one of the earlier Xcode 6 releases? If the latter, then the solution will be to recreate it.

You might be able to take a look inside the storyboard file and find out if it's a valid document - the file is XML based so you should be able to see if there are any missing elements or problems introduced by a merge conflict, for example. You may also be able to try deleting particular screens to see if that resolves your problem - perhaps the issue is in relation to one particular screen.

I'd also suggest checking if your objects have implemented an IBDesignable attribute and if you used that in the storyboard; if so, it might be a failure of the NSCoder to be able to restore the object from the file.

AlBlue
  • 23,254
  • 14
  • 71
  • 91
0

I've been wrestling with the same problem after upgrading from Xcode 5 to 6.0.1. Trying to load my large and complicated iPad storyboard would freeze Xcode, bring up the Pinwheel Of Death, and eventually crash it out. Sometimes it would show errors on build as well, mentioning missing OIDs.

I ended up rolling back the Storyboard file in Git (via the command line since Xcode wouldn't let me get that far) all the way back to the very first straight-from-the-template version. I cleaned the project and rebuilt it, and the storyboard loaded properly.

I then went forward in time commit by commit, cleaning and building every time. I expected I would get to a point where things broke again - but I got all the way up to the most recent commit without any freezes.

When I tried jumping ahead by several weeks, though, I got the freeze-ups and crashes again.

I wonder if the new Storyboard editor in 6.0.1 just needs to build up its internal representations (and caches?) in smaller easy steps rather than the giant leap of a full complicated file.

This rollback/roll forward/rebuild process took about 45 minutes for me, but that's a whole lot less time than it would take for me to rebuild this storyboard. Hope this helps you.

Andrew Burke
  • 118
  • 6
0

One solution to this is to open the xib in Xcode 5 and let it change a bunch of settings. Then open in Xcode 6.

shim
  • 9,289
  • 12
  • 69
  • 108
Mustafa
  • 5,307
  • 1
  • 20
  • 19
0

I just experienced the same thing. It turned out to be a duplicate UILabel in the storyboard due to a git merge. Apparently Xcode will crash if two UI elements have the same internal ID.

Somewhat similar to andrew-burke's method, my method for finding the responsible issue involved tracing through git for the problem change. Steps:

  • Iteratively step backward through the git history, checking out each commit until you find the first storyboard that doesn't crash Xcode.
  • Once you have the commit that started crashing, check out HEAD and iteratively revert the storyboard changes in the problem commit. Continue to narrow it down until you have the one UI element or one line that will cause a crash.
  • Revert the responsible change permanently and restart Xcode. Open the storyboard again and you may be warned about an internal inconsistency. Agree to the proposed changes Xcode makes, but review them.
  • If necessary, you may now attempt to re-create the UI element or changes from scratch that were causing the problem before.
AWrightIV
  • 553
  • 7
  • 15
0

My Xcode crashed when I dragged a button on Main.storyboard to create a IBOutlet.

I found it caused by a build settings item -- [Objective-C Automatic Reference Counting].

If it is set to "No", Xcode will crash on creating a IBOutlet.

OS X Version: Yosemite 10.10.1 

Xcode Version: 6.1.1 (6A2008a)

Hope this helps.

JSK NS
  • 3,346
  • 2
  • 25
  • 42
John
  • 1
0

What worked for me, and still using AutoLayout

  1. Open the storyboard as source code
  2. Editing useAutolayout="YES" to useAutolayout="NO"
  3. Closing the source code
  4. Open the storyboard as Interface Builder - Storyboard
  5. And this is the most important step: In the File Inspector View (left pane) checking "Use AutoLayout"

Done.

mrd
  • 4,561
  • 10
  • 54
  • 92
0

Xcode 7.1 on Mac OS X 10.11.1 crashed and opening same project by right clicking the xcode icon made it crashed again. Then I right the xcode icon and opened some other project from the recent list and then opened the same project which was crashing from xcode's menu recent item and it didn't crash.

zeeawan
  • 6,667
  • 2
  • 50
  • 56
0

I ran into this on Xcode 8, and I was able to

  • save my corrupt storyboard changes on a git branch.
  • switched to a different branch revert to an older commit before the Storyboard got corrupted
  • view storyboard file in Xcode
  • switch to back to branch with corrupt storyboard, and Xcode didn't crash while still viewing the storyboard file
shim
  • 9,289
  • 12
  • 69
  • 108
subjective_c
  • 282
  • 2
  • 10