gpt4 book ai didi

ios - 如何在程序的一次运行中多次在 swift(iOS) 中返回相同的 viewController?

转载 作者:行者123 更新时间:2023-12-01 16:24:19 25 4
gpt4 key购买 nike

我正在使用 SpriteKit 和 UIKit 编写程序。

我的程序中有两个 View Controller ,第一个用于主页,第二个用于 GameViewController(包括 GameScene)。我在 GameViewController 中添加了一个返回按钮,该按钮转到主页 (MainPageViewController)。到目前为止一切正常。

在我的第一页中,当我想再次返回 GameViewController 时,程序崩溃并给出以下错误:

GitarTelleri[959:47801] 15:21:39.405 ERROR:
AVAudioEngineGraph.mm:1743: _Connect: required condition is false: !destNodeMixerConns.empty() && !isDestNodeConnectedToIONode 2016-09-19 15:21:39.413 GitarTelleri[959:47801] * Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: !destNodeMixerConns.empty() && !isDestNodeConnectedToIONode' * First throw call stack: ( 0 CoreFoundation 0x0000000104250d85 exceptionPreprocess + 165 1 libobjc.A.dylib
0x00000001061d2deb objc_exception_throw + 48 2 CoreFoundation
0x0000000104250bea +[NSException raise:format:arguments:] + 106 3
libAVFAudio.dylib 0x000000010915eff3 _Z19AVAE_RaiseExceptionP8NSStringz + 176 4 libAVFAudio.dylib 0x0000000109171bc3 _ZN18AVAudioEngineGraph8_ConnectEP19AVAudioNodeImplBaseS1_jjP13AVAudioFormat + 1281 5 libAVFAudio.dylib 0x0000000109174df0 _ZN18AVAudioEngineGraph7ConnectEP11AVAudioNodeS1_mmP13AVAudioFormat + 322 6 libAVFAudio.dylib 0x00000001091a7a71 _ZN17AVAudioEngineImpl7ConnectEP11AVAudioNodeS1_mmP13AVAudioFormat + 301 7 libAVFAudio.dylib 0x00000001091a7ad8 -[AVAudioEngine connect:to:format:] + 83 8 AudioKit 0x00000001037a611b _TTSf4n_d___TZFC8AudioKit8AudioKits6outputGSqCS_6AKNode_ + 267 9 GitarTelleri 0x000000010362c234 TFC12GitarTelleri18GameViewController13viewDidAppearfSbT + 196 10 GitarTelleri 0x000000010362c341 TToFC12GitarTelleri18GameViewController13viewDidAppearfSbT + 49 11 UIKit 0x0000000104df7335 -[UIViewController _setViewAppearState:isAnimating:] + 830 12 UIKit 0x0000000104e30589 -[UINavigationController viewDidAppear:] + 207 13 UIKit 0x0000000104df7335 -[UIViewController _setViewAppearState:isAnimating:] + 830 14 UIKit 0x0000000104df7cb8 -[UIViewController _endAppearanceTransition:] + 262 15 UIKit 0x0000000104dc208a -[UIPresentationController transitionDidFinish:] + 827 16 UIKit 0x0000000104f9f38f -[_UICurrentContextPresentationController transitionDidFinish:] + 42 17 UIKit
0x0000000104dc57c1 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 183 18 UIKit
0x00000001056844c8 -[_UIViewControllerTransitionContext completeTransition:] + 101 19 UIKit
0x0000000104dbef77 -[UITransitionView notifyDidCompleteTransition:] + 252 20 UIKit 0x0000000104dbec88 -[UITransitionView _didCompleteTransition:] + 1344 21 UIKit 0x0000000104dc13f4 -[UITransitionView _transitionDidStop:finished:] + 104 22 UIKit 0x0000000104ce47ff -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 241 23 UIKit 0x0000000104ce4bae -[UIViewAnimationState animationDidStop:finished:] + 80 24 QuartzCore 0x0000000107d7d3c8 _ZN2CA5Layer23run_animation_callbacksEPv + 308 25 libdispatch.dylib 0x0000000108c773eb _dispatch_client_callout + 8 26 libdispatch.dylib 0x0000000108c5f1ef _dispatch_main_queue_callback_4CF + 1738 27 CoreFoundation 0x00000001041aa0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 9 28 CoreFoundation 0x000000010416bb99 __CFRunLoopRun + 2073 29 CoreFoundation 0x000000010416b0f8 CFRunLoopRunSpecific + 488 30 GraphicsServices
0x000000010a189ad2 GSEventRunModal + 161 31 UIKit
0x0000000104c56f09 UIApplicationMain + 171 32 GitarTelleri
0x0000000103630372 main + 114 33 libdyld.dylib
0x0000000108cab92d start + 1 34 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)



我应该更改 AppDelegate.swift 中的某些内容还是应该在单击 BackButton 时清理某些内容?

最佳答案

检查你的后退按钮是否有 AudioKit.stop()

关于ios - 如何在程序的一次运行中多次在 swift(iOS) 中返回相同的 viewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39573282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com