Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
317 views
in Technique[技术] by (71.8m points)

crash - Xcode Interface Builder crashes when I edit storyboard

I'm new to Xcode and am having problems with the IDE crashing when I use the Interface Builder. This is Xcode 4.5.

It worked properly for long enough for me to add a dozen or so buttons to the storyboard -- but when I try to resize any of them, it crashes and quits. If I move a button, it crashes. If I add a new object like a label, it sometimes crashes, but not always.

If I don't try to edit the storyboard, the project builds and runs on the simulator with no problems.

I've pasted what looks like the relevant part of the crash report below. To save space, I've deleted everything from the 'view hierarchy' section downwards, but I can add it if it's useful. All the crash reports refer to the same error.

Interestingly, when I look at the Console log, there's another report from Interface Builder before each of these crashes:

25/09/2012 10:46:35.661 Interface Builder Cocoa Touch Tool: CFPreferences:
user home directory at file://localhost/Users/me/Library/Application Support/
iPhone Simulator/User/ is unavailable. User domains will be volatile.

It's correct -- that directory doesn't exist. I've got iPhone Simulator/6.0, but nothing else. I'm logged in as the user in that path.

Based on other suggestions on Stack Overflow and elsewhere, I've tried cleaning the build then deleting the entire iPhone Simulator directory and letting the simulator recreate it, but that makes no difference.

As an experiment, I've just created a new Project and dragged some buttons and labels into the storyboard. That seems fine. No crashes.

Does that suggest that something has got corrupted in my other project?

Any suggestions would be very welcome. This is not an important project -- I'm learning my way around at this stage -- but if something is causing problems then I want to sort it out before I start any serious work in Xcode.

Thanks in advance.

James

Process:         Xcode [650]
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 [129]

Date/Time:       2012-09-25 10:46:43.202 +0100
OS Version:      Mac OS X 10.7.5 (11G56)
Report Version:  9

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 arbitrate IBNSLayoutConstraint, IBUIButton, IBUILabel, 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: 
Reason:     All views needing candidate constraints have already had constraints generated. This most likely indicates a bug involving layout of the following views:
Layout engine frame ({{20, 60}, {282, 57}}) of <UILabel: 0xb36f590; frame = (20 60; 281 57); text = '0'; clipsToBounds = YES; opaque = NO; autoresize = TM+BM; userInteractionEnabled = NO; layer = <CALayer: 0xb36f620>> does not match canvas frame ({{20, 60}, {281, 57}})
Layout engine frame ({{236, 328}, {66, 43}}) of <UIRoundedRectButton: 0xb384590; frame = (236 328; 65 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xb384660>> does not match canvas frame ({{236, 328}, {65, 43}})
Layout engine frame ({{236, 124}, {66, 43}}) of <UIRoundedRectButton: 0xb38ea10; frame = (236 124; 65 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xb38eae0>> does not match canvas frame ({{236, 124}, {65, 43}})
Layout engine frame ({{236, 175}, {66, 43}}) of <UIRoundedRectButton: 0xb390a30; frame = (236 175; 65 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xb36e8e0>> does not match canvas frame ({{236, 175}, {65, 43}})
Layout engine frame ({{236, 226}, {66, 43}}) of <UIRoundedRectButton: 0xb392a90; frame = (236 226; 65 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xb392b60>> does not match canvas frame ({{236, 226}, {65, 43}})
Layout engine frame ({{236, 277}, {66, 43}}) of <UIRoundedRectButton: 0xb394b70; frame = (236 277; 65 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xb394c40>> does not match canvas frame ({{236, 277}, {65, 43}})
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Update: Further experimentation revealed the 'Use Autolayout' checkbox for the storyboard. Switching this off then saving the file seems to have fixed the problem. I can edit at will, with no more crashes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...