Search code examples
cocos2d-iphoneios5xcode4.2

how an app can run one time and does not run another time without change


I have a game in cocos2d 2.0. It compiles without errors but one time it runs without error then I press stop and when again I run it, it stops with an error. the next time it runs and the next time does not and so on. even runs work, odd runs do not!

How it is possible?

The assertion that stops the program is

*** Assertion failure in -[CCTexture2D setTexParameters:], /Users/abbas/libs/ios/cocos2d-iphone/cocos2d/CCTexture2D.m:732
2011-11-28 17:54:01.385 floated[6029:10a03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'GL_CLAMP_TO_EDGE should be used in NPOT textures'

I have tracked the error, but my texture is not POT.


Solution

  • I have found the problem. for an unknown reason there was two build rules for my .png texture at it seems that Xcode runs one of them every time, or changes the order of running them every time.

    so when the correct rule runs cocos2d finds the texture and when the other rule runs it does not find the texture file.