My first shot at creating a method with multiple parameters. Still trying to wrap my head around how Objective C does things. Been banging my head for a couple days on this now. Finally ready to ask for help. Searched and tried many posts here on stack overflow. Below is various code chunks I'm working with ... this is a cocos2d v3 project FYI.
// MainPlayScene.h
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#include <sys/sysctl.h>
@interface MainPlayScene : CCScene <CCPhysicsCollisionDelegate>
+ (MainPlayScene *)scene;
- (id)init;
- (void)evaluateTileAttack:(CCNode*)tileTouchedCCNode : (CCNode*)tileTouchedCCNode2;
@end
// MainPlayScene.m
#import "cocos2d.h"
#import "MainPlayScene.h"
@implementation MainPlayScene
{
CCNode *tileTouchedCCNode;
CCNode *tileTouchedCCNode2;
}
+ (instancetype)scene
{
return [[self alloc] init];
}
- (id)init
{
return self;
}
- (void)evaluateTileAttack: (CCNode*)ccnode1 : (CCNode*)ccnode2
{
NSLog(@"ccnode1: %@", ccnode1.physicsBody.collisionType);
NSLog(@"ccnode2: %@", ccnode2.physicsBody.collisionType);
}
- (void)actionMenuAttackHandler: (id)sender
{
[self evaluateTileAttack: tileTouchedCCNode, tileTouchedCCNode2];
^^^^^^^^^^^^^^^^^^^^^
error at this line
}
@end
ERROR: No visible @interface for 'MainPlayScene' declares the selector 'evaluateTileAttack:'
Not sure why I am getting this error because I think I am declaring in MainPlayScene.h properly ...