I downloaded the template project, and when I have ported all my files and resources over to this new one, it crashes with this line:
[[CCDirector sharedDirector] replaceScene:[CCFadeTransition transitionWithDuration:1 scene:[MainMenu scene] withColor:ccc3(0, 0, 0)]];
This is in my selector in my splash screen class:
@interface SplashScreen : CCLayer {
NSTimer *splashTimer;
}
+ (id)scene;
- (void)splashTimerCallback;
@end
and my implementation:
@implementation SplashScreen
- (id)init {
if ((self = [super init])) {
CCSprite *splash = [CCSprite spriteWithFile:@"480x320-splash-angry-01.png"];
splash.opacity = 0;
[splash setPosition:CGPointMake(240, 160)];
[self addChild:splash];
[splash runAction:[CCFadeIn actionWithDuration:1]];
splashTimer = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(splashTimerCallback) userInfo:nil repeats:NO];
}
return self;
}
+ (id)scene {
CCScene *scene = [CCScene node];
SplashScreen *layer = [SplashScreen node];
[scene addChild:layer];
return scene;
}
- (void)splashTimerCallback {
[[CCDirector sharedDirector] replaceScene:[CCFadeTransition transitionWithDuration:1 scene:[MainMenu scene] withColor:ccc3(0, 0, 0)]];
}
- (void)dealloc {
[super dealloc];
}
@end
Why is it crashing? It works fine in my other project, just not this new one.