a bug for setPosition() ?

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)
offset = 10;
posX += offset;
this
>setPosition(ccp(posX,0));
}

———— CODE END ——————-

I resolved the problem, the cause was the pixelFormat & depthFormat.
To change parameter to kEAGLColorFormatRGB565 from kEAGLColorFormatRGBA8 and 0 from GL_DEPTH_COMPONENT16_OES.
It really works fine but I don’t know what real reason lead to the issue.
Maybe the framebuffer pixel format of target and simulator are a little different ? (16bits V.S. 32 bits ?)

EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]
pixelFormat: kEAGLColorFormatRGB565//kEAGLColorFormatRGBA8
depthFormat: 0//GL_DEPTH_COMPONENT16_OES
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples:0 ];