【问题标题】:Xcode 4.5 storyboard crashingXcode 4.5 故事板崩溃
【发布时间】:2012-09-22 09:30:35
【问题描述】:

当我尝试在情节提要中编辑 UILabel 时,Xcode 经常崩溃。有什么想法可能导致这种情况吗?看起来它与自动布局约束之一有关。这是错误报告:

Process:         Xcode [43938]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.5 (1839)
Build Info:      IDEApplication-1839000000000000~3
App Item ID:     497799835
App External ID: 10747437
Code Type:       X86-64 (Native)
Parent Process:  launchd [43283]

Date/Time:       2012-10-01 09:43:36.443 -0400
OS Version:      Mac OS X 10.7.4 (11E53)
Report Version:  9
Sleep/Wake UUID: 8C7C93A7-0BEF-42C6-944C-488D8C7896DD

Interval Since Last Report:          152594 sec
Crashes Since Last Report:           6
Per-App Interval Since Last Report:  135715 sec
Per-App Crashes Since Last Report:   5
Anonymous UUID:                      E745D8FE-362B-4FD2-8594-7EC5C26767B2

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

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

Application Specific Information:
ProductBuildVersion: 4G182
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-1926/IBPlugin/Utilities/IBObjectMarshalling.m:651
Details:  Failed to start deciding frames for IBNSLayoutConstraint, IBUILabel, IBUITabBarItem, IBUITableView, IBUIView, and IBUIViewController.

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: IBAssertionFailure
Exception reason: ASSERTION FAILURE: realConstraint
Reason:     Should have found real constraint for represented constraint <NSLayoutConstraint:0x86a8c30 H:[UIView:0x868a0f0(71)]>
File:       /SourceCache/IBAutolayoutFoundationIOS/IBAutolayoutFoundation-1818/Framework/Classes/Arbitration/IBAutolayoutEngine.m:223
Method:     __76-[IBAutolayoutEngine realConstraintsFromCollectionOfRepresentedConstraints:]_block_invoke_0
Exception backtrace: 
  0. CoreFoundation           0x022a4012 __exceptionPreprocess
  1. libobjc.A.dylib          0x01703e7e objc_exception_throw
  2. CoreFoundation           0x0232cfb1 -[NSException raise]
  3. ???                      0x0000beae [IBCocoaTouchTool startAutolayoutFrameDecisionSessionWithRequest:document:]
  4. ???                      0x000342a5 [IBMessageReceiveChannel deliverMessage:toTarget:withArguments:result:]
  5. ???                      0x00033fa9 [IBMessageReceiveChannel deliverMessage:toTarget:withArguments:result:]
  6. ???                      0x00033c47 [IBMessageReceiveChannel runBlockingReceiveLoopNotifyingQueue:notifyingTarget:]
  7. libdispatch.dylib        0x04c3d731 _dispatch_barrier_sync_f_slow_invoke
  8. libdispatch.dylib        0x04c4c014 _dispatch_client_callout
  9. libdispatch.dylib        0x04c3c7d5 _dispatch_main_queue_callback_4CF
 10. CoreFoundation           0x0224aaf5 __CFRunLoopRun
 11. CoreFoundation           0x02249f44 CFRunLoopRunSpecific
 12. CoreFoundation           0x02249e1b CFRunLoopRunInMode
 13. Foundation               0x01308c7c -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
 14. ???                      0x0000cf06 [IBCocoaTouchTool startServingReceiveChannel:]
 15. ???                      0x0000d09f [IBCocoaTouchTool startServingWithSocket:]
 16. ???                      0x0000e1b7 [IBCocoaTouchTool .cxx_destruct]
 17. ???                      0x00002365 ???
Exception info:{
}

【问题讨论】:

  • 在处理情节提要中的元素时,我也遇到了 Xcode 崩溃的问题,但在谷歌搜索后我找不到答案。我想补充一下(如果它可以帮助任何人找到答案):我只是在 Xcode 的最新更新(4.5)之后才体验过它,我在故事板中复制/粘贴圆形矩形按钮以及调整大小时体验过它标签。我正在运行 OS X 10.8.2。
  • 这里有同样的问题。我不知道是什么原因造成的,但这令人难以置信。同样,每当我尝试添加另一个圆形矩形按钮时。

标签: ios xcode interface-builder uistoryboard autolayout


【解决方案1】:

一种解决方法是从 Storyboard 剪切并粘贴到 .xib。

* 对我来说,当 ContainerView 被拖到画布上时,它会在带有 .xib 的 IB 中崩溃。 Xcode 版本 8.2.1。

【讨论】:

    【解决方案2】:

    我也有同样的问题……在带有“圆角矩形按钮”的情节提要中工作时,它会崩溃。有时只有一两个按钮,有时我可以添加十个按钮,然后它就崩溃了。

    编辑: 经过一些实验后,我在情节提要的“文件检查器”中取消选中“使用自动布局”并且它可以工作。 也许你会试一试。

    【讨论】:

    • 感谢您的建议,当我每次添加容器视图时 IB 崩溃时,这对我有用。每次我添加一个,嵌入转场将指向一个看起来像零宽度的视图控制器场景(故事板上非常小、薄的场景)。取消选中“使用自动布局”后,创建的场景与容器视图的大小相同,应该是这样。之后您可以重新启用自动布局。
    • 我遇到了同样的问题。不幸的是,取消选中“使用自动布局”并不能解决问题。
    猜你喜欢
    • 2015-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-06
    • 2016-01-11
    • 2017-01-14
    • 2013-09-27
    相关资源
    最近更新 更多