问题
Very often when I try to edit UILabels in storyboard, Xcode is crashing. Any ideas what could be causing this? It looks like it has something to do with one of the autolayout constraints. Here's the error report:
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:{
}
回答1:
I have the same problem… when working in a storyboard with "Rounded Rect Buttons" it crashes. Sometimes with one or two buttons, sometimes I can add ten buttons and then it crashes.
Edit: After some experiments I have unchecked "Use Autolayout" in the "File Inspector" of the Storyboard and it works. Maybe you'll give it a try.
回答2:
A work around is to cut & paste from a Storyboard to the .xib.
* For me, it crashes in IB with .xib when ContainerView is dragged to the canvas. Xcode Version 8.2.1.
来源:https://stackoverflow.com/questions/12674868/xcode-4-5-storyboard-crashing