我是Swift新手。在新的IOS發佈之前,我的遊戲在蘋果商店中工作。現在,它可以成功構建,但點擊「開始」按鈕時會失敗。 我找不到任何錯誤的代碼。升級到Xcode 8後,我的遊戲停止工作
請檢查下面的異常: -
異常 'NSInvalidArgumentException',理由是: 'SKAction animateWithTextures:紋理數組不能爲空' ***第一擲調用堆棧: ( 0的CoreFoundation 0x0000000109cca34b exceptionPreprocess + 171 1 libobjc.A。dylib 0x00000001093c521e objc_exception_throw + 48 2的CoreFoundation 0x0000000109d33265 + [NSException提高:格式:] + 197 3 SpriteKit 0x000000010a7e1f81 + [SKAnimate animateWithTextures:timePerFrame:調整:還原:] + 120 4 SpriteKit 0x000000010a7ddd71 + [SKAction(SKActions)animateWithTextures:timePerFrame :] + 29 5 TwistyPlane 0x0000000108dc3aea _TFC11TwistyPlane9GameScenecfT5coderCSo7NSCoder_GSqS0 + 906 6 TwistyPlane 0x0000000108dc3c0d _TToFC11TwistyPlane9GameScenecfT5coderCSo7NSCoder_GSqS0__ + 45 7基金會0x0000000108e95f12 _decodeObjectBinary + 2622 8基金會0x0000000108e953c6 _decodeObject + 249 9 SpriteKit 0x000000010a84126b + [SKNode點頭eWithFileNamed:] + 578 10 TwistyPlane 0x0000000108dc6fdd _TTOFCSo7SKSceneCfT9fileNamedSS_GSqS__ + 77 11 TwistyPlane 0x0000000108dc6d31 _TFC11TwistyPlane18GameViewController11viewDidLoadfT_T_ + 129 12 TwistyPlane 0x0000000108dc7032 _TToFC11TwistyPlane18GameViewController11viewDidLoadfT_T_ + 34 13的UIKit 0x000000010abcf06d - [UIViewController中loadViewIfRequired] + 1258 14的UIKit 0x000000010abcf4a0 - [UIViewController的視圖] + 27 15 UIKit 0x000000010b4938d0 - [UIFullscreenPresentationController _setPresentedViewController:] + 87 16 UIKit 0x000000010aba9d26 - [UIPresentationController initWithPresentedViewController:presentingViewController:] + 141 17 UIKit 0x000000010abe230b - [UIView控制器_presentViewController:withAnimationController:完成:] + 3956 18的UIKit 0x000000010abe56df - [UIViewController中_performCoordinatedPresentOrDismiss:動畫:] + 530 19的UIKit 0x000000010abe51c5 - [UIViewController中presentViewController:動畫:完成:] + 179 20的UIKit 0x000000010abea892 - [UIViewController中_showViewController:爲action :發送方:] + 274 21的UIKit 0x000000010b0af1b6 66- [UIStoryboardShowSegueTemplate newDefaultPerformHandlerForSegue:] _ block_invoke + 134 22的UIKit 0x000000010b20840d - [UIStoryboardSegueTemplate _performWithDestinationViewController:發送方:] + 447 23的UIKit 0x000000010b20821d - [UIStoryboardSegueTemplate _perform:] + 82 24的UIKit 0x000000010b2 084df - [UIStoryboardSegueTemplate執行:] + 156 25的UIKit 0x000000010aa2fb88 - [UIApplication的sendAction:爲:從:forEvent:] + 83 26的UIKit 0x000000010abb52b2 - [UIControl sendAction:至:forEvent:] + 67 27的UIKit 0x000000010abb55cb - [UIControl _sendActionsForEvents:withEvent:方法] + 444 28的UIKit 0x000000010abb44c7 - [UIControl touchesEnded:withEvent:方法] + 668 29的UIKit 0x000000010aa9d0d5 - [一個UIWindow _sendTouchesForEvent:] + 2747 30的UIKit 0x000000010aa9e7c3 - [一個UIWindow的SendEvent:] + 4011 31的UIKit 0x000000010aa4ba33 - [UIApplication sendEvent:] + 371 32 UIKit 0x000000010b23db6d __dispatchPreprocessedEventFromEventQueue + 3248 33 UIKit 0x000000010b236 817 __handleEventQueue + 4879 34的CoreFoundation 0x0000000109c6f311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 35的CoreFoundation 0x0000000109c5459c __CFRunLoopDoSources0 + 556 36的CoreFoundation 0x0000000109c53a86 __CFRunLoopRun + 918 37的CoreFoundation 0x0000000109c53494 CFRunLoopRunSpecific + 420個 38個GraphicsServices 0x000000010ff39a6f GSEventRunModal + 161 39的UIKit 0x000000010aa2df34 UIApplicationMain + 159 40 TwistyPlane 0x0000000108dc956f main + 111 41 libdyld.dylib 0x000000010dceb68d start + 1 ) libC++ abi。dylib:以NSException類型的未捕獲異常終止 (lldb)
你將不得不縮小下來更多的嘗試和幫助,最讓我可以從這個講的是,這可能是一起animateWithTextures地方在你的代碼的調用的問題。您需要在代碼斷開之前將代碼調試到最後一行,仔細檢查以確保它們與您看到的內容沒有任何問題,並嘗試在此處再次發佈以查看。 – DreamerNo56
您需要格式化您的代碼演示文稿。 – Rob