Im getting two warnings when i build and run my code. The App still works and it doesn’t crash but I don’t understand why I’m getting the two warnings. The first warning is listed in the title and the second warning states “Method ‘-checkForAndResolveCollisions’ not found.
-(id) init
{
if( (self=[super init]) ) {
CCLayerColor *blueSky = [[CCLayerColor alloc] initWithColor:ccc4(100, 100, 250, 255)];
[self addChild:blueSky];
map = [[CCTMXTiledMap alloc] initWithTMXFile:@"level1.tmx"];
[self addChild:map];
player = [[Player alloc] initWithFile:@"koalio_stand.png"];
player.position = ccp(100, 50);
[map addChild:player z:15];
[self schedule:@selector(update:)];
walls = [map layerNamed:@"walls"]; *
}
return self;
}
-(void)update:(ccTime)dt
{
[player update:dt];
[self checkForAndResolveCollisions:player]; **
}
Title warning is shown on the line with *
The method not found warning is shown on the line with **
Looks like you simply need to add the method declaration for “
checkForAndResolveCollisions:” to that class .h / @interface file.