编辑故事板时,Xcode Interface Builder崩溃 [英] Xcode Interface Builder crashes when I edit storyboard

查看:844
本文介绍了编辑故事板时,Xcode Interface Builder崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Xcode,并且在使用Interface Builder时遇到IDE崩溃的问题。这是Xcode 4.5。

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.

有趣的是,当我查看控制台日志时,在每次崩溃之前,Interface Builder还有一个报告:

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.

这是正确的 - 该目录不存在。我有iPhone模拟器/ 6.0,但没有别的。我以该路径中的用户身份登录。

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.

根据Stack Overflow和其他地方的其他建议,我已尝试清理构建版本,然后删除整个iPhone模拟器目录并让模拟器重新创建它,但这没有什么区别。

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?

非常欢迎。这不是一个重要的项目 - 我在这个阶段学习我的方式 - 但如果一些是导致问题,那么我想排序,在我开始任何严重的工作在Xcode。

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.

提前感谢。

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}})


推荐答案

更新:进一步的实验揭示了故事板的使用自动布局复选框。关闭这个关闭然后保存文件似乎已经解决了问题。我可以随意编辑,不会再有任何崩溃。

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.

这篇关于编辑故事板时,Xcode Interface Builder崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆