I am scheduling a selector in CCTouchesBegan() function and then unscheduling it in CCTouchesEnded() function.
But before unScheduling it in CCTouchesEnded(), I am checking whether a selector is scheduled or not as follows :
You can do an alternative.
You could create a bool member variable that will be true if updateScroller is running and set it to false if it is not. You can then check this variable in the ccTouchesBegan method.
Of course, you would need to manually set the variable to true when you start scheduling updateScroller and set it to false when you unschedule updateScroller
I tried it and I’m getting a linker error and linker error usually means that the object/method you are accessing does not exist.
I think the reason is that schedule_selector* requires a method that accepts afloat* argument. In your case you need to have updateScroller* accept a float parameter, likeupdateScroller( float dt )*
I’m not sure, though. I’ve never tested it myself.