Hi
I am trying to use scheduleOnce in my class/namespace, but Xcode gives me this error:
No member named 'scheduleOnce' in 'MyNS::MyTestClass'
So obviously I need to somehow add CCNode scheduleOnce in my class, but I cannot figure how to do that.
Here is my .h file:
//
// MyTest.h
#include "cocos2d.h"
USING_NS_CC;
namespace MyNS {
class MyTestClass{
public:
MyTestClass();
~MyTestClass();
static MyTestClass* shared();
static void destroy();
int prevent;
void preventRelease();
void setPrevent();
};
}
And here is my .cpp file:
//
// MyTest.cpp
#include "MyTest.h"
namespace MyNS {
void MyTestClass::preventRelease() {
prevent = 0;
printf("===RELEASED prevent \n");
}
void MyTestClass::setPrevent() {
prevent = 1;
printf("===SET prevent \n");
this -> scheduleOnce( schedule_selector( MyTestClass::preventRelease ) , 10.0f ); //PROBLEM HERE
}
}
The problem line is:
this -> scheduleOnce( schedule_selector( MyTestClass::preventRelease ) , 10.0f );
I am sure there is some simple way of including it, but I cannot figure it out.
Any help will be appreciated.
Thanks