hi,
I create a helloworld project and add the codes to project. It work fine in Simulator but target(iPhone 4S) doesn’t
The result screen is breakage.
I use the sample code for cocos2d and both Simulator and target work fine.
Any suggestion for the case ?
———— CODE START ——————-
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
CCNode* n = CCNode::node();
n~~>setContentSize);
this~~>addChild(n);
CCLayerColor c = CCLayerColor::layerWithColor);
c~~>setContentSize);
n~~>addChild;
CCSprite h = CCSprite::spriteWithFile(“HelloWorld.png”);
h~~>setPosition);
n~~>addChild(h);
this~~>schedule, 0.05);
return true;
}
void HelloWorld::updateCamera
{
static float posX = 0;
static float offset = 10;
if
offset =~~10;
else if (posX < 150)>setPosition(ccp(posX,0));
offset = 10;
posX += offset;
this
}
———— CODE END ——————-