EAGLView resize

How can I resize EAGLView?
I want the resolution of the main screen is different from airplay secondary screen.
But I init EAGLView again by this function below:
[EAGLView viewWithFrame: r pixelFormat: kEAGLColorFormatRGBA8
depthFormat: GL_DEPTH_COMPONENT16
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples:0];

it will show nothing ,and console log show
OpenGL error 0x0502 in ……/libs/cocos2dx/sprite_nodes/CCSprite.cpp draw 620

and I try these function below,it’s also not working.
[glView setFrame:r];
[glView setBounds:r];
[glView layoutSubviews];

Is it possible to resize EAGLView or recreate EAGLView?
Thanks.
Regards.