cocos2d-js beta 的 setInterval 坑死爹

开发环境:cocos2d-js beta, Xcode 5.1.1,iOS 6.1 模拟器


setInterval(function(){
    cc.log('interval!!!!!');
}, 1000);

每隔1秒打印一句话,但是只打印了一次。纠结了我半天才找到解决方法。
jsb_cocos2d.js 里 setInterval 的定义里,将 cc.Director.getInstance().getScheduler().scheduleCallbackForTarget(target, target.fun, delay / 1000, cc.REPEAT_FOREVER, 0, false);
cc.REPEAT_FOREVER 改为 0xffffffff 就正常了,我打印了一下 cc.REPEAT_FOREVER 是一个浮点数。

cc.REPEAT_FOREVER 赋值的地方是这么说的:
// XXX: This definition is different than cocos2d-html5
// cc.REPEAT_FOREVER = - 1;
// We can’t assign -1 to cc.REPEAT_FOREVER, since it will be a very big double value after
// converting it to double by JS_ValueToNumber on android.
// Then cast it to unsigned int, the value will be 0. The schedule will not be able to work.
// I don’t know why this occurs only on android.
// So instead of passing -1 to it, I assign it with max value of unsigned int in c++.
cc.REPEAT_FOREVER = 0xffffffff;

我也 don’t know 啊!