I'm having a spot of trouble with this. I've created a new CocosNode as describes above (fixing the cpSpacehas(h)Each) spelling mistake. But I don't quite get the "&drawEachShape" part.
I defined and implemented a method in the class, but I get a "drawEachShape undeclared (first use in this function)" error. Here' the code...
#import "ChipmunkDebug.h"
@implementation ChipmunkDebug
-(id) initWithSpace:(cpSpace *)pSpace
{
if((self == [super init])){
space = pSpace;
}
return self;
}
-(void) draw
{
//I'm only interested in Static Shapes at the moment
cpSpaceHashEach( space->staticShapes, &drawEachShape, nil );
}
-(void) drawEachShape:(cpShape *)thisShape
{
}
i also tried [self drawEachShape] and @selector(drawEachShape:) but still got nowhere. I'm blindly feeling my way through this.
I suspect it's got something to do with C and Objective C differences, but could someone point out what I need to do? Cheers.