I have an app that is running fine in the iPhone simulator by way of Xcode. When I attempt to run the app on the iPod touch, I am receiving the following error;
2012-05-25 19:40:33.014 PracticeOne[602:707] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil 2012-05-25 19:40:33.016 PracticeOne[602:707] cocos2d: Couldn't add image:Success1.png in CCTextureCache 2012-05-25 19:40:33.025 PracticeOne[602:707] * Assertion failure in -[Game addChild:z:], /IOSDevelopment/PracticeOne/PracticeOne/libs/cocos2d/CCNode.m:407
I have a Success1.png image that is stored in the Resources folder.
When the user taps the submit button, the following logic is executed;
//show success graphic on screen
CCSprite *goodWord = [CCSprite spriteWithFile:@"Success1.png"];
[goodWord setPosition:ccp(s.width / 2, s.height / 2) ];
[self addChild:goodWord z:200];
id action1 = [CCFadeIn actionWithDuration:1.5];
id action2 = [CCFadeOut actionWithDuration:1.5];
[goodWord runAction:action1];
[goodWord runAction:action2];
So, I retrieve the png file, position it and add it to the Scene. I run actions to fade the image in and out. It appears briefly and goes away, showing the user they were successful.
When I debug the code running on the device, goodWord does not contain an address after attempting to retrieve Success1.png.
Does anyone have any idea why it may succeed in the simulator and throw this error in one the device? I have other images from the Resources folder appearing fine on the device.
Any tips or suggestions would be greatly appreciated. I will keep looking for a solution and update if I am successful.
Thanks in advance.