本文介绍了无法打开storyboard(com.apple.InterfaceBuilder错误-1。)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在几个开发人员在我们的某个应用程序中处理故事板后,我们现在在尝试在Xcode Interface Builder中打开故事板时收到此错误:

After several developers were working on the storyboard in one of our apps, we are now getting this error when trying to open the storyboard in Xcode Interface Builder:

检查控制台日志以获取更多信息。

Check the console log for additional information.

我们都在运行最新版本的Xcode(4.6.2 4H1003),并且所有更改都是在Interface Builder中对故事板进行的。控制台日志中没有显示其他信息。我假设错误是指同一个控制台日志,其中显示日志和调试语句,这是完全空的。

We are all running the latest version of Xcode (4.6.2 4H1003) and all changes were made to the storyboard in Interface Builder. There is no additional information showing in the console log. I'm assuming the error is referring to the same console log where log and debug statements appear, which is completely empty.

其中一个开发人员在尝试时收到同样的错误在我正在处理的另一个应用程序中打开故事板。这个故事板在我的计算机上为Xcode打开了,但是,我们从不打扰在当时更多地查看错误(这是几个月前的第一次)。但是这一次,我们都得到了同样的错误(我们中的4个人已经测试过在我们自己的计算机上打开它。)

One of the developers receives this same error when trying to open the storyboard in another of our apps I was working on. This storyboard opens fine for me in Xcode on my computer however, so we never bothered to look into the error more at the time (this first occurred a few months ago). But this time, we all get the same error (4 of us have tested opening it on our own computers).

我们正在使用GitHub来管理我们的源控制项目,使用几个不同的Git客户端。有关导致此错误的原因以及如何解决此问题的任何想法?

We are using GitHub to manage our source control on both projects, using a few different Git clients. Any ideas as to what is causing this error and how to fix it?

更新:这是/ var / logs / system的输出尝试打开故事板后,我的电脑上的.log:

UPDATE: This is the output to /var/logs/system.log on my computer after trying to open the storyboard:

Jun  5 16:38:44 my-computer-host-name Xcode[271]: Exception raised while unarchiving document objects - *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Jun  5 16:38:45 my-computer-host-name Xcode[271]: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-2113/Framework/Classes/Editor/IDEEditorDocument.m:1364
    Details:  Message sent to invalidated IBStoryboardDocument instance <IBStoryboardDocument: 0x40ecc34c0>. Backtrace for invalidation:
       0  0x000000010d814f86 -[IDEEditorDocument _invalidate] (in IDEKit)
      1  0x000000010d883291 -[IDEEditorDocument initForURL:withContentsOfURL:ofType:error:] (in IDEKit)
      2  0x00000001103005d0 -[IBDocument initForURL:withContentsOfURL:ofType:error:] (in IDEInterfaceBuilderKit)
      3  0x000000010d882efd +[IDEDocumentController _newEditorDocumentWithClass:forURL:withContentsOfURL:ofType:extension:error:] (in IDEKit)
      4  0x000000010d882dba -[IDEEditorContext _newEditorDocumentWithClass:forURL:withContentsOfURL:ofType:extension:error:] (in IDEKit)
      5  0x000000010d88290c -[IDEEditorContext _openNavigableItem:withContentsOfURL:documentExtension:shouldInstallEditorBlock:] (in IDEKit)
      6  0x000000010d991628 -[IDEEditorContext _notifyDelegateAndOpenNavigableItem:withContentsURL:documentExtensionIdentifier:locationToSelect:annotationRepresentedObject:stateDictionary:annotationWantsIndicatorAnimation:exploreAnnotationRepresentedObject:highlightSelection:] (in IDEKit)
      7  0x000000010d8bfe7b -[IDEEditorContext _notifyDelegateAndOpenEditorOpenSpecifier:updateHistory:] (in IDEKit)
      8  0x000000010d8bf99c -[IDEEditorContext _openEditorOpenSpecifier:updateHistory:] (in IDEKit)
      9  0x000000010d8bf8ba -[IDEEditorContext openEditorOpenSpecifier:] (in IDEKit)
     10  0x000000010d8cbf40 -[IDEEditorGeniusMode openEditorOpenSpecifier:editorContext:] (in IDEKit)
     11  0x000000010d8bf76e -[IDEEditorArea _openEditorOpenSpecifier:editorContext:takeFocus:] (in IDEKit)
     12  0x000000010d9a3174 __108+[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:]_block_invoke (in IDEKit)
     13  0x000000010d8bf6cc +[IDEEditorCoordinator _doOpenWithWorkspaceTabController:editorContext:target:allowFallback:documentURL:usingBlock:] (in IDEKit)
     14  0x000000010d8bf12d +[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:] (in IDEKit)
     15  0x000000010d8bed45 -[_IDEOpenRequest _runIfNecessary] (in IDEKit)
     16  0x00007fff8bfde395 __NSFireDelayedPerform (in Foundation)
     17  0x00007fff8b169804 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
     18  0x00007fff8b16931d __CFRunLoopDoTimer (in CoreFoundation)
     19  0x00007fff8b14ead9 __CFRunLoopRun (in CoreFoundation)
     20  0x00007fff8b14e0e2 CFRunLoopRunSpecific (in CoreFoundation)
     21  0x00007fff8ac57eb4 RunCurrentEventLoopInMode (in HIToolbox)
     22  0x00007fff8ac57c52 ReceiveNextEventCommon (in HIToolbox)
     23  0x00007fff8ac57ae3 BlockUntilNextEventMatchingListInMode (in HIToolbox)
     24  0x00007fff85f5d563 _DPSNextEvent (in AppKit)
     25  0x00007fff85f5ce22 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
     26  0x00007fff85f541d3 -[NSApplication run] (in AppKit)
     27  0x00007fff85ef8c06 NSApplicationMain (in AppKit)
     28  0x000000010cbc9b6f (in Xcode)
     29  0x000000010cbc9b00 (in Xcode)
     30  0x0000000000000002

    Object:   <IBStoryboardDocument: 0x40ecc34c0>
    Method:   -updateChangeCount:
    Thread:   <NSThread: 0x40030a220>{name = (null), num = 1}
    Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

这是尝试在另一个项目中打开故事板后其他开发人员计算机上的日志输出我们得到同样的错误(这是在我的电脑上打开的故事板):

And this is the log output on the other dev's computer after trying to open the storyboard in the other project that we get this same error on (this is the storyboard that opens fine on my computer):

Jun  5 17:20:13 other-dev-computer-host-name Xcode[157]: Exception raised while unarchiving document objects - *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Jun  5 17:20:13 other-dev-computer-host-name Xcode[157]: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-2113/Framework/Classes/Editor/IDEEditorDocument.m:1364
    Details:  Message sent to invalidated IBStoryboardDocument instance <IBStoryboardDocument: 0x409ec3340>. Backtrace for invalidation:
       0  0x000000010d746f86 -[IDEEditorDocument _invalidate] (in IDEKit)
      1  0x000000010d7b5291 -[IDEEditorDocument initForURL:withContentsOfURL:ofType:error:] (in IDEKit)
      2  0x00000001102755d0 -[IBDocument initForURL:withContentsOfURL:ofType:error:] (in IDEInterfaceBuilderKit)
      3  0x000000010d7b4efd +[IDEDocumentController _newEditorDocumentWithClass:forURL:withContentsOfURL:ofType:extension:error:] (in IDEKit)
      4  0x000000010d7b4dba -[IDEEditorContext _newEditorDocumentWithClass:forURL:withContentsOfURL:ofType:extension:error:] (in IDEKit)
      5  0x000000010d7b490c -[IDEEditorContext _openNavigableItem:withContentsOfURL:documentExtension:shouldInstallEditorBlock:] (in IDEKit)
      6  0x000000010d7d9c96 -[IDEEditorContext _openNavigableItem:withContentsOfURL:shouldInstallEditorBlock:] (in IDEKit)
      7  0x000000010d8c3667 -[IDEEditorContext _notifyDelegateAndOpenNavigableItem:withContentsURL:documentExtensionIdentifier:locationToSelect:annotationRepresentedObject:stateDictionary:annotationWantsIndicatorAnimation:exploreAnnotationRepresentedObject:highlightSelection:] (in IDEKit)
      8  0x000000010d7f1e7b -[IDEEditorContext _notifyDelegateAndOpenEditorOpenSpecifier:updateHistory:] (in IDEKit)
      9  0x000000010d7f199c -[IDEEditorContext _openEditorOpenSpecifier:updateHistory:] (in IDEKit)
     10  0x000000010d7f18ba -[IDEEditorContext openEditorOpenSpecifier:] (in IDEKit)
     11  0x000000010d7f189f -[IDEEditorModeViewController openEditorOpenSpecifier:editorContext:] (in IDEKit)
     12  0x000000010d7f176e -[IDEEditorArea _openEditorOpenSpecifier:editorContext:takeFocus:] (in IDEKit)
     13  0x000000010d8d5174 __108+[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:]_block_invoke (in IDEKit)
     14  0x000000010d7f16cc +[IDEEditorCoordinator _doOpenWithWorkspaceTabController:editorContext:target:allowFallback:documentURL:usingBlock:] (in IDEKit)
     15  0x000000010d7f112d +[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:] (in IDEKit)
     16  0x000000010d7f0d45 -[_IDEOpenRequest _runIfNecessary] (in IDEKit)
     17  0x00007fff98955395 __NSFireDelayedPerform (in Foundation)
     18  0x00007fff909bd804 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
     19  0x00007fff909bd31d __CFRunLoopDoTimer (in CoreFoundation)
     20  0x00007fff909a2ad9 __CFRunLoopRun (in CoreFoundation)
     21  0x00007fff909a20e2 CFRunLoopRunSpecific (in CoreFoundation)
     22  0x00007fff92e5eeb4 RunCurrentEventLoopInMode (in HIToolbox)
     23  0x00007fff92e5ec52 ReceiveNextEventCommon (in HIToolbox)
     24  0x00007fff92e5eae3 BlockUntilNextEventMatchingListInMode (in HIToolbox)
     25  0x00007fff96036563 _DPSNextEvent (in AppKit)
     26  0x00007fff96035e22 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
     27  0x00007fff9602d1d3 -[NSApplication run] (in AppKit)
     28  0x00007fff95fd1c06 NSApplicationMain (in AppKit)
     29  0x000000010caf9b6f (in Xcode)
     30  0x000000010caf9b00 (in Xcode)
     31  0x0000000000000002

Object:   <IBStoryboardDocument: 0x409ec3340>
Method:   -updateChangeCount:
Thread:   <NSThread: 0x40030a1a0>{name = (null), num = 1}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

两个日志输出非常相似。在第6行的第二个输出的调用堆栈中还有一行: [IDEEditorContext _openNavigableItem:withContentsOfURL:shouldInstallEditorBlock:](在IDEKit中)。第11行(第1行10)引用方法 IDEEditorModeViewController 而不是 IDEEditorGeniusMode 。否则日志输出是相同的。

Both log outputs are very similar. There is an additional line in the call stack of the 2nd output at line 6: [IDEEditorContext _openNavigableItem:withContentsOfURL:shouldInstallEditorBlock:] (in IDEKit). And line 11 (10 on the 1st) references the method IDEEditorModeViewController instead of IDEEditorGeniusMode. Otherwise the log outputs are identical.

注意,我们最初收到此错误的第二个故事板不会出现Git合并冲突的问题,因为我是唯一的开发人员在这个故事板上工作过。我根本不需要将提交合并到这个存储库,因为我是它的唯一贡献者。

Note, this 2nd storyboard that we originally received this error on would not have had a problem with Git merge conflicts as I am the only developer to have worked on this storyboard. I've never needed to merge commits to this repository at all as I'm the sole contributing developer on it.

推荐答案

是该项目使用任何自定义字体?

Is the project using any custom fonts?

我只花了一整天时间来处理完全相同的问题(尝试了多台具有多个XCode版本的计算机),并在我安装了两个自定义字体之后立即处理了项目故事板能够打开。

I just spent all day long dealing with the exact same issue (tried multiple computers with multiple XCode versions), and immediately after I installed the two custom fonts we had in the project the Storyboards were able to open.

我收到了invalidate异常以及数组异常的混合。数组异常导致一位开发人员发现,他意识到我们有自定义字体。

I received a mix of both the "invalidate" exception as well as an array exception. And the array exception led a fellow developer to a similar StackOverflow question where he realized we had custom fonts.

这篇关于无法打开storyboard(com.apple.InterfaceBuilder错误-1。)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-20 23:55