2016-10-04 141 views
0

我是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)

+1

你将不得不缩小下来更多的尝试和帮助,最让我可以从这个讲的是,这可能是一起animateWithTextures地方在你的代码的调用的问题。您需要在代码断开之前将代码调试到最后一行,仔细检查以确保它们与您看到的内容没有任何问题,并尝试在此处再次发布以查看。 – DreamerNo56

+0

您需要格式化您的代码演示文稿。 – Rob

回答

1

它说你的错误在第一行“SKAction animateWithTextures:纹理数组不能为空”检查你的代码并确保满足这个投诉。看起来好像您正在调用或使用空数组来调用数据。程序崩溃,因为没有任何回报。这就是我所看到的。

相关问题