Xcode crashes when I open a specific XIB file

别来无恙 提交于 2019-12-06 10:53:30

问题


I had a XIB file which worked fine until today - when I try to open it in Xcode, the beachball appears and after 1 minute Xcode crashes. Others XIBs work just fine. Also, if I just build and run the project right to my device, its also work (and XIB works at the app).

Here is the error message:

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4G1004
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-1929/IBPlugin/Utilities/IBObjectMarshalling.m:651
Details:  Failed to arbitrate IBNSLayoutConstraint, IBUIButton, IBUIImageView, IBUILabel, IBUITextField, and IBUIView.

Interface Builder encountered an error communicating with the iOS Simulator. If you choose to file a crash report or radar for this issue, please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" and include their content in your crash report.

Exception name: NSInternalInconsistencyException

I will appreciate any ideas and thoughts!


回答1:


Are you using the autoLayout Property ? Uncheck the checkbox that says Use AutoLayout and it should work fine. Unchecking this and then saving the file seems to fix the problem for me earlier. check this link for further details Xcode Interface Builder crashes when I edit storyboard




回答2:


If Xcode crashes as soon as you click on the xib file, you won't be able to uncheck Use AutoLayout. Here's how you can change it:

  1. Right-click on the .xib file in the Project Navigator
  2. Choose Open As... > Source Code
  3. Find this line towards the end: <bool key="IBDocument.UseAutolayout">YES</bool>
  4. Change YES to NO
  5. Save File
  6. Right-click on the .xib file again in the Project Navigator
  7. Choose Open As... > Interface Builder - iOS


来源:https://stackoverflow.com/questions/17670585/xcode-crashes-when-i-open-a-specific-xib-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!