Hi,
I am using this function to call a static function on collision of two objects in chipmunk.
cpSpaceAddCollisionHandler(space, 1, 2, CollisionFunction, NULL, NULL, NULL, NULL);
// I am using this line in init
static function that is called
static int CollisionFunction(cpArbiter *arb, cpSpace *space, void *unused)
{
cpShape *a, *b;
cpArbiterGetShapes(arb, &a, &b);
//[self MyFunction]; this line gives error that self is not defined
return 1;
}
My static functions are defined in current class(inherited from CCLayer).
Now I wish to call a function in my Current class from this static function. when ever I write [self ....]. it says self is not defined.
any suggestion to call this function(MyFunction in above commented code).
thanks in advance