Hey. Here's my code with I use to create sprite thanks to cocos2d.
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"bambusowy.plist"];
CCSpriteSheet *teksturySheet = [CCSpriteSheet spriteSheetWithFile:@"bambusowy.png"];
[self addChild:teksturySheet];
NSString * stttt = [NSString stringWithUTF8String: tex_dane[mapa1[i][0]].c_str()];
CCSprite *teksturka = [CCSprite spriteWithSpriteFrameName:stttt];
This code works fine on the Simulator, but it crash on the device. Here are the logs:
Tue Aug 10 15:36:39 unknown menu panda[1271] : * Assertion failure in -[CCSprite initWithTexture:rect:], /Users/.... libs/cocos2d/CCSprite.m:183
Tue unknown menu panda[1271] : * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid texture for sprite'
I guess the problem is that it cant select texture from an atlas...