Okay guys, having a weird issue here. See, in XCode4, when I try to run my app either in debug mode, or just normally, it loads up fine. The initial scene presents a menu with a "Start" game option.
Now, when I run it in the simulator in the two modes I mentioned earlier, it crashes at this point in the thread, with an EXC_BAD_ACCESS error:
0x0169009b <+0015> mov 0x8(%edx),%edi
Oddly enough, it works absolutely fine when I run in Profile mode, either on my device, or within the simulator.
It just started doing this about an hour ago. Code is pretty simple... All I did in the past day that could have affected the menu was add in a sound effect upon selecting a menu item. Disabling the sound still causes the same issue. In any case, here is the relevant code:
-(void) start: (id) sender {
[[SimpleAudioEngine sharedEngine] playEffect:@"pong.wav"];
[[CCDirector sharedDirector] replaceScene:[Master initWithLevel:1]];
}
// on "init" you need to initialize your instance
-(id) init
{
if( (self=[super init])) {
[CCMenuItemFont setFontName:@"Marker Felt"];
[CCMenuItemFont setFontSize:35];
CCMenuItem *item1 = [CCMenuItemFont itemFromString:@"Start" target:self selector:@selector(start:)];
CCMenu * menu = [CCMenu menuWithItems:item1, nil];
[self addChild:menu];
}
return self;
}
I've closed xCode, reset my MacBook Pro, but it still persists. Hmmm, if I had a dime for every time XCode gave me an unexplainable error (in some cases, that is ironically the actual error message!), I'd be a millionaire ;)
-G.