我刚开始使用Xcode,当使用Interface Builder时,IDE崩溃了。我的Xcode版本是4.5。
在我向storyboard中添加了大约十二个按钮之后,它正常工作--但是当我尝试调整任何一个按钮的大小时,它就会崩溃并退出。如果我移动一个按钮,它会崩溃。如果我添加一个新对象,比如标签,它有时会崩溃,但不总是。
如果我不尝试编辑storyboard,则该项目可以在模拟器上构建和运行,没有问题。
下面是看起来与崩溃报告相关的部分。为了节省空间,我删除了从'view hierarchy'部分向下的所有内容,但如果有用的话,我可以添加它们。所有的崩溃报告都涉及同一个错误。
有趣的是,当我查看Console日志时,在每次崩溃之前都有另一个来自Interface Builder的报告:
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 Simulator / 6.0,但没有其他东西。我以该路径下的用户身份登录。
基于Stack Overflow和其他地方的建议,我尝试了清理构建,然后删除整个iPhone Simulator目录,让模拟器重新创建它,但是没有任何区别。
作为一个实验,我刚刚创建了一个新项目,并将一些按钮和标签拖放到故事板中。看起来很好。没有崩溃。
那是否表明我的其他项目出现了某些损坏?
任何建议都非常受欢迎。这不是一个重要的项目 - 我在这个阶段学习 - 但是如果有什么问题,我想在开始在Xcode中进行任何严肃工作之前解决它。
提前致谢。
詹姆斯
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}})