草庐IT

Xcode 7/Swift 2 Storyboard崩溃 - Beta 1 和 4

coder 2023-09-16 原文

在没有警告的情况下,当我单击 Storyboard文件时,我的 xcode 应用程序突然开始崩溃。通过一些挖掘,我发现很多人都说要这样做:

"Go to

/Library/Developer/CoreSimulator/Profiles/Runtimes

 and remove the profiles in there. Restart Xcode and it should work!"

当我在 finder 中搜索这个文件夹时,使用转到文件夹功能,它说找不到。其他人说要清除 colorPickers,但这对我来说仍然不起作用。 Xcode 在 beta 1 和 4(我有)中都崩溃了。我真的需要一些帮助。

UPDATE 此错误消息也出现在警告通知中: 由于缺少入口点,场景无法访问,并且没有通过 -instantiateViewControllerWithIdentifier: 进行运行时访问的标识符。

这是崩溃时的弹出窗口:

Process:               Xcode [6312]
Path:                  /Applications/Xcode-beta.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               7.0 (8163.8)
Build Info:            IDEFrameworks-8163008000000000~7
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [6312]
User ID:               501

Date/Time:             2015-07-27 11:55:06.545 -0500
OS Version:            Mac OS X 10.11 (15A225f)
Report Version:        11
Anonymous UUID:        CCD99EAB-C0B0-7A00-2973-B979C02BC5E7

Sleep/Wake UUID:       AB09C466-CD98-48A5-B0DE-2D18DB8F52CB

Time Awake Since Boot: 5500 seconds
Time Since Wake:       3400 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 7A152u
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-8152.3/InterfaceBuilderKit/Utilities/IBPlatformToolFailureHandler.m:315
Details:  Failed to determine the values for ibLayoutInset, intrinsicContentSize, baselineOffsetFromBottom, firstBaselineOffsetFromTop, ibLayoutMargins, ibLeftBarButtonItemTitleRects, ibRightBarButtonItemTitleRects, ibLeftBarButtonItemFrames, ibRightBarButtonItemFrames, and ibTitleViewFrame of IBUINavigationBar.

Encountered an error communicating with Interface Builder Cocoa Touch Tool. If you choose to file a crash report or Radar for this issue, please zip and attach the diagnostics at "/var/folders/p7/2jw_957n4t12wkx9hm4vn_tc0000gn/T/IB-agent-diagnostics_2015-07-27_11-55-06_310000" to your crash report.

Exception name: IBPlatformToolFailureException
Exception reason: The agent crashed

Application Specific Information:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <AVPlayerViewController 0x7c84ee00> for the key path "playerController.hasEnabledAudio" from <AVPlayerViewController 0x7c84ee00> because it is not registered as an observer.'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 169 - Device: iPad 2 - Runtime: iOS 9.0 (13A4293g) - DeviceType: iPad 2


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x06937632 __pthread_kill + 10
1   libsystem_pthread.dylib         0x068ff4a8 pthread_kill + 101
2   libsystem_c.dylib               0x066a247d abort + 156
3   libc++abi.dylib                 0x0624fae7 abort_message + 151
4   libc++abi.dylib                 0x06270683 default_terminate_handler() + 300
5   libobjc.A.dylib                 0x025960d7 _objc_terminate() + 108
6   libc++abi.dylib                 0x0626dd0d std::__terminate(void (*)()) + 14
7   libc++abi.dylib                 0x0626d93e __cxa_rethrow + 103
8   libobjc.A.dylib                 0x02595fce objc_exception_rethrow + 47
9   com.apple.CoreFoundation        0x029e3fe0 CFRunLoopRunSpecific + 672
10  com.apple.CoreFoundation        0x029e3d2b CFRunLoopRunInMode + 123
11  com.apple.Foundation            0x021af30e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
12  com.apple.dt.IBFoundation       0x01e2c257 -[IBAbstractPlatformTool startServingReceiveChannel:] + 471
13  com.apple.dt.IBFoundation       0x01e2c45d -[IBAbstractPlatformTool startServingWriteDescriptor:readDescriptor:] + 129
14  com.apple.dt.IBFoundation       0x01e2d0e9 +[IBAbstractPlatformTool main] + 1325
15  Interface Builder Cocoa Touch Tool  0x00058753 0x57000 + 5971
16  libdyld.dylib                   0x065f5a21 start + 1


Last command:
_ON_QUEUE_sendMessage:toChannelReturningError:during:

Backtrace of last command:
  0  0x000000011b7ca76d -[IBAbstractPlatformToolProxy _ON_QUEUE_sendMessage:toChannelReturningError:during:] (in IDEInterfaceBuilderKit)
  1  0x000000011b7ca632 __74-[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:]_block_invoke (in IDEInterfaceBuilderKit)
  2  0x00007fff8cd02c45 _dispatch_client_callout (in libdispatch.dylib)
  3  0x00007fff8cd036f2 _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)
  4  0x000000010e3d7370 DVTDispatchSync (in DVTFoundation)
  5  0x000000011b7ca555 -[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:] (in IDEInterfaceBuilderKit)
  6  0x000000011ca0273a (in IDEInterfaceBuilderCocoaTouchIntegration)
  7  0x000000011ca17fde (in IDEInterfaceBuilderCocoaTouchIntegration)
  8  0x000000011cb48b8c (in IDEInterfaceBuilderCocoaTouchIntegration)
  9  0x000000011cb4547e (in IDEInterfaceBuilderCocoaTouchIntegration)
 10  0x000000011b9491fa -[NSView(IBViewIntegration) ibLayoutInset] (in IDEInterfaceBuilderKit)
 11  0x000000011b949606 -[NSView(IBViewIntegration) ibLayoutBounds] (in IDEInterfaceBuilderKit)
 12  0x000000011b9496bc -[NSView(IBViewIntegration) ibLayoutFrame] (in IDEInterfaceBuilderKit)
 13  0x000000011b95c631 -[NSView(IBViewIntegration) ibLoggingDescription] (in IDEInterfaceBuilderKit)
 14  0x000000011b95c80d -[NSView(IBViewIntegration) ibDefaultSubtreeDescription] (in IDEInterfaceBuilderKit)
 15  0x0000000117ea1f90 -[NSObject(IBAutolayoutObjectIntegration) ibRecursivelyAddSubtreeDescriptionToString:indentation:layoutInfo:withIteratorBlock:andAdditionalDescriptionsBlock:] (in IBAutolayoutFoundation)
 16  0x0000000117ea22d3 -[NSObject(IBAutolayoutObjectIntegration) ibSubtreeDescriptionWithLayoutInfo:withIteratorBlock:startingIndentation:andAdditionalDescriptionsBlock:] (in IBAutolayoutFoundation)
 17  0x0000000117e79729 -[IBAutolayoutArbitrationUnit debugDescription] (in IBAutolayoutFoundation)
 18  0x000000011c9d1428 (in IDEInterfaceBuilderCocoaTouchIntegration)
 19  0x000000011b7a6e51 +[IBPlatformToolFailureHandler failureHandlerWithContext:failure:diagnosticsHandlerBlock:] (in IDEInterfaceBuilderKit)
 20  0x000000011c9d2022 (in IDEInterfaceBuilderCocoaTouchIntegration)
 21  0x000000011b6a2e9e __72-[IBDocumentAutolayoutManager updateAutolayoutStatusInArbitrationUnits:]_block_invoke (in IDEInterfaceBuilderKit)
 22  0x000000011b69bd33 -[IBDocumentAutolayoutManager _runAutolayoutCommandForArbitrationUnits:withBlock:] (in IDEInterfaceBuilderKit)
 23  0x000000011b6a2da5 -[IBDocumentAutolayoutManager updateAutolayoutStatusInArbitrationUnits:] (in IDEInterfaceBuilderKit)
 24  0x000000011b6a31c5 -[IBDocumentAutolayoutManager didFireAutolayoutStatusDelayedInvocation:] (in IDEInterfaceBuilderKit)
 25  0x000000010e22afc8 -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
 26  0x000000010e22b53a -[DVTDelayedInvocation invokeIfNeeded] (in DVTFoundation)
 27  0x000000010e22bb17 -[DVTDelayedInvocation invoke] (in DVTFoundation)
 28  0x000000011b6a24ef -[IBDocumentAutolayoutManager autolayoutStatusForArbitrationUnitContainingObject:] (in IDEInterfaceBuilderKit)
 29  0x000000011b69ef36 -[IBDocumentAutolayoutManager isItemMisplaced:] (in IDEInterfaceBuilderKit)
 30  0x000000011b69f4f9 __61-[IBDocumentAutolayoutManager itemsWithCleanAutolayoutStatus]_block_invoke (in IDEInterfaceBuilderKit)
 31  0x0000000117f5bfde -[NSSet(IBSetAdditions) ib_setByFilteringUsingBlock:] (in IBFoundation)
 32  0x000000011b69f49e -[IBDocumentAutolayoutManager itemsWithCleanAutolayoutStatus] (in IDEInterfaceBuilderKit)
 33  0x000000011b6a3470 -[IBDocumentAutolayoutManager preserveCleanAutolayoutStatusDuring:] (in IDEInterfaceBuilderKit)
 34  0x000000011b6861e4 -[IBDocument preserveCleanAutolayoutStatusDuring:] (in IDEInterfaceBuilderKit)
 35  0x000000011b86ceec -[IBResourceManager synchronizeObjectPropertyValuesWithVariantContext] (in IDEInterfaceBuilderKit)
 36  0x000000011b86a400 __66-[IBResourceManager setupVariantContextWithContainerRepositories:]_block_invoke (in IDEInterfaceBuilderKit)
 37  0x000000010fb9452c -[IDEMediaResourceVariantContext registerVariantContextObserverWithOptions:block:] (in IDEKit)
 38  0x000000011b869fb2 -[IBResourceManager setupVariantContextWithContainerRepositories:] (in IDEInterfaceBuilderKit)
 39  0x000000011b86a557 -[IBResourceManager setResourceProvidingContainer:] (in IDEInterfaceBuilderKit)
 40  0x000000011b65ffda -[IBDocument setResourceProvidingContainer:] (in IDEInterfaceBuilderKit)
 41  0x000000011b65ec9d -[IBDocument refreshWorkspaceSourcedContent] (in IDEInterfaceBuilderKit)
 42  0x000000011b65ef63 -[IBDocument registerWorkspaceDocument:forEditorViewController:] (in IDEInterfaceBuilderKit)
 43  0x000000011b53b940 -[IBAbstractDocumentEditor viewDidInstall] (in IDEInterfaceBuilderKit)
 44  0x000000011b8c9355 -[IBStoryboardDocumentEditor viewDidInstall] (in IDEInterfaceBuilderKit)
 45  0x000000010ea565f8 -[DVTViewController _didInstallContentView:] (in DVTKit)
 46  0x000000010e842345 -[DVTControllerContentView _viewDidInstall] (in DVTKit)
 47  0x000000010e841be2 -[DVTControllerContentView viewDidMoveToWindow] (in DVTKit)
 48  0x00007fff97ceb33e -[NSView _setWindow:] (in AppKit)
 49  0x00007fff97cf605b -[NSView addSubview:] (in AppKit)
 50  0x00007fff97ea6533 -[NSView setSubviews:] (in AppKit)
 51  0x000000010e834ac8 -[DVTBorderedView setContentView:] (in DVTKit)
 52  0x000000010f59a2cd -[IDEEditorContext _setEditorView] (in IDEKit)
 53  0x000000010f7424e0 -[IDEEditorContext setupNewEditor:] (in IDEKit)
 54  0x000000010f743dc9 __91-[IDEEditorContext _openNavigableItem:documentExtension:document:shouldInstallEditorBlock:]_block_invoke (in IDEKit)
 55  0x000000010f5a976b -[IDEEditorContext _performBlockInsideReentrantGuard:] (in IDEKit)
 56  0x000000010f5a923b -[IDEEditorContext _openNavigableItem:documentExtension:document:shouldInstallEditorBlock:] (in IDEKit)
 57  0x000000010f5dba67 -[IDEEditorContext _openNavigableItem:withContentsOfURL:documentExtension:shouldInstallEditorBlock:] (in IDEKit)
 58  0x000000010f745698 -[IDEEditorContext _notifyDelegateAndOpenNavigableItem:withContentsURL:documentExtensionIdentifier:locationToSelect:annotationRepresentedObject:stateDictionary:annotationWantsIndicatorAnimation:exploreAnnotationRepresentedObject:highlightSelection:alwaysReplaceExistingNavigableItem:skipSubDocumentNavigationUnlessEditorIsReplaced:] (in IDEKit)
 59  0x000000010f61ae82 -[IDEEditorContext _notifyDelegateAndOpenEditorOpenSpecifier:updateHistory:] (in IDEKit)
 60  0x000000010f61a739 -[IDEEditorContext _openEditorOpenSpecifier:updateHistory:] (in IDEKit)
 61  0x000000010f61a59a -[IDEEditorContext openEditorOpenSpecifier:] (in IDEKit)
 62  0x000000010f61a480 -[IDEEditorModeViewController openEditorOpenSpecifier:editorContext:] (in IDEKit)
 63  0x000000010f61a2cc -[IDEEditorArea _openEditorOpenSpecifier:editorContext:takeFocus:] (in IDEKit)
 64  0x000000010f783756 __108+[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:]_block_invoke (in IDEKit)
 65  0x000000010f61a16d +[IDEEditorCoordinator _doOpenWithWorkspaceTabController:editorContext:target:allowFallback:documentURL:usingBlock:] (in IDEKit)
 66  0x000000010f619a39 +[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:] (in IDEKit)
 67  0x000000010f6195bf -[_IDEOpenRequest _runIfNecessary] (in IDEKit)
 68  0x00007fff9781efd8 __NSFireDelayedPerform (in Foundation)
 69  0x00007fff892da5d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
 70  0x00007fff892da263 __CFRunLoopDoTimer (in CoreFoundation)
 71  0x00007fff893571ba __CFRunLoopDoTimers (in CoreFoundation)
 72  0x00007fff89295e21 __CFRunLoopRun (in CoreFoundation)
 73  0x00007fff89295488 CFRunLoopRunSpecific (in CoreFoundation)
 74  0x00007fff96cdc701 RunCurrentEventLoopInMode (in HIToolbox)
 75  0x00007fff96cdc497 ReceiveNextEventCommon (in HIToolbox)
 76  0x00007fff96cdc2d7 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 77  0x00007fff97d4469b _DPSNextEvent (in AppKit)
 78  0x00007fff981115d9 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
 79  0x000000010e9555fe -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 80  0x00007fff97d3a54c -[NSApplication run] (in AppKit)
 81  0x00007fff97cbc6e2 NSApplicationMain (in AppKit)
 82  0x00007fff8d8f55ad start (in libdyld.dylib)

最佳答案

从你的日志来看,问题似乎出在这里:

*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <AVPlayerViewController 0x7c84ee00> for the key path "playerController.hasEnabledAudio" from <AVPlayerViewController 0x7c84ee00> because it is not registered as an observer.'
terminating with uncaught exception of type NSException

这是一篇涵盖该主题的帖子,您可能会觉得有帮助。

NSNotification removeObserver problem

更新

我不确定您的代码是什么样子,但控制台的输出告诉您问题出在哪里。就找出问题所在而言,我会在崩溃前放置一个断点。例如,如果您有一个 IBAction 绑定(bind)到一个 UIButton,请在其中放置一个断点并单步执行它以查看导致问题的行。

在寻找答案方面,您会发现 Objective-C 是一条走得更远的路。对于大多数事情,语法与 Swift 非常相似,因此如果您在 Objective-C 中找到一个潜在的解决方案,您很可能能够拼凑出一个等效的 Swift 行。

您可能会发现这些“备忘单”很有用:

RW Swift Cheat Sheet

RW Objective-C Cheat Sheet

如果您可以隔离项目中有问题的函数/方法,您可能希望将其与崩溃时的控制台输出一起包含在您的问题中。

关于Xcode 7/Swift 2 Storyboard崩溃 - Beta 1 和 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31658415/

有关Xcode 7/Swift 2 Storyboard崩溃 - Beta 1 和 4的更多相关文章

  1. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  2. Ruby Readline 在向上箭头上使控制台崩溃 - 2

    当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby​​安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少

  3. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  4. ruby-on-rails - Rails 4.1.0.beta1 升级失败 - 2

    我最近尝试安装rails4.1.0.beta1,但是railss导致以下错误。[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/core_ext/module/aliasing.rb:32:in`alias_method':undefinedmethod`graft'forclass`ActiveRecord::Associations::JoinDependency'(NameError)[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4

  5. ruby-on-rails - 如何使用 Xcode 4.5.1 在 OSX Lion 10.8.2 上编译 EventMachine gem - 2

    我找遍了所有我能找到的地方,但似乎找不到解决这个问题的办法。我在Lion10.8.2上使用Xcode4.5.1,并尝试为Rails项目运行bundle,但它一直卡在这上面。我正在为Heroku使用Thingem。Bolanos@Jeremys-Mac-mini⦿-1.9.3fishfarm$sudogeminstalleventmachinePassword:Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingeventmachine:ERROR:Failedtobuildgemnativeextens

  6. ruby-on-rails - Rails 4.2.0.beta2 - 无法连接到 LocalHost? - 2

    我按照RailsTutorial.org第三版(刚刚发布的版本)中的说明安装了Rails4.2.0.beta2。我没有使用cloudIDE,而是在带有RVM的Windows7主机上通过Vagrant使用UbuntuTrusty32。rails_4.2.0.beta2_newhello_app然后粘贴到hisgemfilesample中。在那之后,我跑了:$bundleinstall$railss服务器启动正常,但是当我尝试连接到localhost:3000时,出现“找不到服务器”更奇怪的是,我还有几个其他的Rails入门项目,我一直在使用Rails4.0.3和4.1.6,我能够很好地连

  7. ruby - 在多个线程中引用类方法会导致自动加载循环依赖崩溃 - 2

    代码:threads=[]Thread.abort_on_exception=truebegin#throwexceptionsinthreadssowecanseethemthreadseputs"EXCEPTION:#{e.inspect}"puts"MESSAGE:#{e.message}"end崩溃:.rvm/gems/ruby-2.1.3@req/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:478:inload_missing_constant':自动加载常量MyClass时检测到循环依赖稍加研究后,

  8. ruby-on-rails - ActionCable 无需升级到 Rails 5 beta - 2

    我目前有一个运行在4.2.5上的Rails应用程序,我想使用ActionCable而不必将整个应用程序升级到Rails5.0.0.beta3版本并冒破坏所有其他gem的风险。按照我在互联网上看到的指南,我已经尝试过gem'actioncable',github:'rails/actioncable'这不起作用,因为ActionCable存储库已合并到Rails存储库中。我什至试过gem'actioncable',github:'rails/rails'但这似乎不适用于ActionCable合并到Rails时发生的版本重新编号。(唯一低于5.0.0.beta*的版本是0.0.0,这似乎是

  9. ruby - 执行过期异常使 Ruby 线程崩溃,但处理了 Timeout::Error - 2

    任何人都可以解释为什么当对方法的调用看起来像这样时我可能会看到这个堆栈(由HTTParty::post请求引起):beginresponse=HTTParty::post(url,options)rescuelogger.warn("Couldnotpostto#{url}")rescueTimeout::Errorlogger.warn("Couldnotpostto#{url}:timeout")end堆栈:/usr/local/lib/ruby/1.8/timeout.rb:64:in`timeout'/usr/local/lib/ruby/1.8/net/protocol.rb

  10. ruby - vim 使用 AutoComplPop 插件崩溃 - 2

    我使用vim编辑ruby​​文件,但是当我输入“.”时它崩溃了。我发现它是由AutoComplPop插件引起的。我该怎么办? 最佳答案 我找到了一种使用autocomplpop和filetype=ruby来防止vim崩溃的方法。将以下行放入您的.vimrcletg:acp_behaviorRubyOmniMethodLength=-1这将防止在您键入“.”时触发autocomplpop。(期间)这不是解决办法。(我不是vim插件程序员)祝你好运! 关于ruby-vim使用AutoComp

随机推荐