A Bug in repeated Schedule in version 2.2.0

A Bug in repeated Schedule in version 2.2.0
0.0 0


i add a repeated schedule selector. it’s run normally in simulator but one time in my device(iphone4 ios6.1.3).
then i debug it and get the problem.

in cocos2d_specifics.cpp JSBool js_CCScheduler_schedule(JSContext cx, uint32_t argc, jsvalvp)

double repeat = 1;
>scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCObj, interval, repeat, delay, paused);

repeat has been convert from double to unsigned int. in simulator (unsigned int)repeat is –1,but in device it’s 0.so the schedule only run one time in device.

i am not sure this problem is same in android device. someone who has an android device can do this test?

please test it.

i got a notice that number cast result may different between simulator and device sometimes. It’s may useful for you. sorry for my writting english. thank you!


Hi, i got the same result in android-phone.
But i don’t think it’s a bug. it’s just the different result from the forced change of type, especially with default value.


Hi Shujun Qian. Thank you for reply.

yes. it’s just a type-convert problem. we can’t take control of the force change of type. but i think we should do something to make the repeated schedule running normaly in device.

Thank you again.


:frowning: , My first name is Qiao, thanks.
we should be using explicit data type or operations for these marginal-value or default value, Don’t you think so?


sorry Qiao.

yes.maybe my description is unexplicited. my problem is it’s in cocos2d source code( cocos2d_specifics.cpp/JSBool js_CCScheduler_schedule(JSContext cx, uint32_t argc, jsvalvp)). i just want someone can fix it and when i use cocos2d jsb next time it will running normally without modify the source code.


This problem was fixed in cocos2d-x-3.0alpha1.