我是Swift的新手。在新的IOS发布之前,我的游戏正在Apple商店中运行。现在它可以成功构建但是当我单击“开始”按钮时它会失败。 我的代码无法找到任何问题。
请检查以下例外情况: -
exception' NSInvalidArgumentException',原因:' SKAction animateWithTextures:textures数组不能为空' ***第一次抛出调用堆栈: ( 0 CoreFoundation 0x0000000109cca34b exceptionPreprocess + 171 1 libobjc.A.dylib 0x00000001093c521e objc_exception_throw + 48 2 CoreFoundation 0x0000000109d33265 + [NSException raise:format:] + 197 3 SpriteKit 0x000000010a7e1f81 + [SKAnimate animateWithTextures:timePerFrame:resize:restore:] + 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 nodeWithFileNamed:] + 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:presentsViewController:] + 141 17 UIKit 0x000000010abe230b - [UIViewController _presentViewController:withAnimationController:completion:] + 3956 18 UIKit 0x000000010abe56df - [UIViewController _performCoordinatedPresentOrDismiss:animated:] + 530 19 UIKit 0x000000010abe51c5 - [UIViewController presentViewController:animated:completion:] + 179 20 UIKit 0x000000010abea892 - [UIViewController _showViewController:withAction:sender:] + 274 21 UIKit 0x000000010b0af1b6 66- [UIStoryboardShowSegueTemplate newDefaultPerformHandlerForSegue:] _ block_invoke + 134 22 UIKit 0x000000010b20840d - [UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 447 23 UIKit 0x000000010b20821d - [UIStoryboardSegueTemplate _perform:] + 82 24 UIKit 0x000000010b2084df - [UIStoryboardSegueTemplate执行:] + 156 25 UIKit 0x000000010aa2fb88 - [UIApplication sendAction:to:from:forEvent:] + 83 26 UIKit 0x000000010abb52b2 - [UIControl sendAction:to: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 0x000000010b236817 __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)
答案 0 :(得分:1)
它表示您在第一行“SKAction animateWithTextures:textures数组不能为空”中的错误检查您的代码并确保满足此投诉。看起来好像在调用或使用空数组来调用数据。程序崩溃了,因为没有什么可以返回的。这就是我所看到的。