Hello I am getting the dreaded "EXC_BAD_ACCESS" when attempting to switch to a EAGLView -
I understand from what I have read on the forum that I might be "retaining" an object incorrectly - but I am not sure how to find this. Any suggestions would be greatly appreciated.
From my console -
run
Running…
[Switching to thread 12035]
[Switching to thread 12035]
sharedlibrary apply-load-rules all
continue
2010-08-10 12:35:38.514 cocos2dXrefTest[13501:207] Received memory warning. Level=1
Program received signal: “EXC_BAD_ACCESS”.
(gdb)
My code is as follows:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Init the view
newView = [[UIView alloc] initWithFrame:[[UIView mainScreen] bounds]];
// must be called before any other call to the director
if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] )
[CCDirector setDirectorType:kCCDirectorTypeThreadMainLoop];
CCDirector *director = [CCDirector sharedDirector];
// set FPS at 60
[director setAnimationInterval:1.0/60];
// Display FPS: yes
[director setDisplayFPS:YES];
// before creating any layer, set the landscape mode
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
// Create an EAGLView with a RGB8 color buffer, and a depth buffer of 24-bits
EAGLView *glView = [EAGLView viewWithFrame:[newView bounds]];
[director setOpenGLView:glView];
// High res mode
// [director setContentScaleFactor:2];
[glView setMultipleTouchEnabled:YES];
CCScene *scene = [CCScene node];
[scene addChild: [LayerExample node]];
[director runWithScene:scene];
return YES;
}