0
votes

I get assertion failure error when try to rotate sprite, i guess. The game sim run well exception sometime this error happen. I don't known why?

and this my Log file:

Assertion failure in -[CCSprite rotation], /Users/SCN/Desktop/Stick-ninja-test/Stick-ninja-test/libs/cocos2d/CCNode.m:207 2015-03-24 08:39:42.207 Fish-hunt[548:a0b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCNode#rotation. RotationX != RotationY. Don't know which one to return' * First throw call stack: ( 0 CoreFoundation 0x02c1b5e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x022678b6 objc_exception_throw + 44 2 CoreFoundation 0x02c1b448 +[NSException raise:format:arguments:] + 136 3 Foundation 0x019c2fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 4 Fish-hunt 0x000f4f8c -[CCNode rotation] + 236 5 Fish-hunt 0x00084dd5 -[GameLayer update:] + 7621 6 Fish-hunt 0x000e46af -[CCScheduler update:] + 447 7 Fish-hunt 0x000e4e01 -[CCDirectorIOS drawScene] + 225 8 Fish-hunt 0x000e68e4 -[CCDirectorDisplayLink mainLoop:] + 52 9 QuartzCore 0x0130db8a _ZN2CA7Display15DisplayLinkItem8dispatchEv + 48 10 QuartzCore 0x0130da46 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 310 11 QuartzCore 0x0130df6b _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123 12 CoreFoundation 0x02bd9bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 22 13 CoreFoundation 0x02bd95bd __CFRunLoopDoTimer + 1181 14 CoreFoundation 0x02bc1628 __CFRunLoopRun + 1816 15 CoreFoundation 0x02bc0ac3 CFRunLoopRunSpecific + 467 16 CoreFoundation 0x02bc08db CFRunLoopRunInMode + 123 17 GraphicsServices 0x0396b9e2 GSEventRunModal + 192 18 GraphicsServices 0x0396b809 GSEventRun + 104 19 UIKit 0x00360d3b UIApplicationMain + 1225 20 Fish-hunt 0x00099a46 main + 134 21 Fish-hunt 0x00002a05 start + 53 ) libc++abi.dylib: terminating with uncaught exception of type NSException

Would you tell my why? thanks

1
reason: 'CCNode#rotation. RotationX != RotationY. Don't know which one to return' - YvesLeBorg
Yes, i know it. But my code use ccsprite.rotation, so why rotationX != rotationY. - user3243028
Finally, i resove it. Thanks - user3243028

1 Answers

0
votes

I know you got the answer, but you have not mentioned how you resolved it. So I am giving how I resolved the same for other user having the same problem.

If you are using only setRotation() and getRotation(). check the value at some point in setRotation() is invalid like NaN or someother value which is not valid. Cocos2d does not give error while setting but after that when you do getRotation(), it gives the error.