简体   繁体   中英

Storyboard crashes Xcode when opened

Whenever I attempt to open up my storyboard, Xcode crashes with the following error report

崩溃报告

The funny thing is, the app works fine in the simulator and builds without errors. What is causing this crash? I see two possible crashes:

Exception reason: UITableView dataSource is not set

, but that shouldn't make the storyboard crash right?

Details:  Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.

Which doesn't give much information at all.

I have been using a storyboard with Xcode 5 for some time, so the question does not appear to be related to moving from Xcode 4 to 5. I can open the storyboard as XML and I can open my iPhone storyboard just fine.

If you are using git, I would recommend reverting to a time before this problem started.

If you are not using git, and you are absolutely sure you did not edit the xml for the storyboard then I would say:

1)find the storyboard file using the finder. 2)copy it to your desktop. 3)go back to Xcode and delete the storyboard from your project, select "move to trash". 4)re-import the storyboard file into your project.

Ive had similar problems with Xcode 5 and either reverting using git or the steps above usually get me back up and running.

Exception reason: UITableView dataSource is not set

Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.

The errors described above lead me to think that one if not all viewcontroller(s) for the items listed above lost their connectivity to viewcontroller.h / viewcontroller.m files. I would make sure you have everything wired up correctly, and you can check this by making sure the items in your viewcontroller have a circle in the gutter (next to the line numbers) that is filled in (solid) if the circle is not filled in then it means your items are not wired up to your viewcontroller. I would post a picture of your .h / .m file of your viewcontroller so we can further investigate.

I ended up copying each view controller scene (in XML) into a new storyboard. Some view controllers could not be copied without the storyboard crashing so I had to recreate about 4 of them, but by and large I got the majority of my work back.

What you need to do is reopen the project again in Xcode 5 and then go to the storyboard. Then at the right side choose for "Identity and type" and then set "opens in" to Xcode 4.6 to be able to open it in Xcode 4.6. And disable auto layout, somehow when you open it in xcode 5 it asks you to update it, I think you did that without a thought, happened to me as well :)

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM