I'm having an issue compiling my app in 'Release' mode in Xcode 3.2.3 with Cocos2d 0.99.3. It works and runs on my device fine in 'Debug' mode, however, when I change it to 'Release' mode it errors with EXC_BAD_INSTRUCTION pointing to this code:
+ (BOOL) setDirectorType:(ccDirectorType)type
{
NSAssert(_sharedDirector==nil, @"A Director was alloced. setDirectorType must be the first call to Director");
if( type == CCDirectorTypeDisplayLink ) {
NSString *reqSysVer = @"3.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if([currSysVer compare:reqSysVer options:NSNumericSearch] == NSOrderedAscending)
return NO;
}
switch (type) {
case CCDirectorTypeNSTimer:
[CCTimerDirector sharedDirector];
break;
case CCDirectorTypeDisplayLink:
[CCDisplayLinkDirector sharedDirector];
break;
case CCDirectorTypeMainLoop:
[CCFastDirector sharedDirector];
break;
case CCDirectorTypeThreadMainLoop:
[CCThreadedFastDirector sharedDirector];
break;
default:
NSAssert(NO,@"Unknown director type");
}
return YES;
}
Any ideas?