Why Schduler function is not called?
2013-01-25 15:41
357 查看
The
reason it didn't work for me is that I didn't add the object to the scene layer. Apparently if it's not part of a scene, it is automatically set to paused. As for you, this should be just fine, but if you don't want to add it as a child, I decided to use the
objective c functions scheduling.
To schedule:
[[CCScheduler sharedScheduler] scheduleSelector:@selector(tick:) forTarget:self interval:0.0 paused:NO];
To unschedule
[[CCScheduler sharedScheduler] unscheduleSelector:@selector(tick:) forTarget:self];
reason it didn't work for me is that I didn't add the object to the scene layer. Apparently if it's not part of a scene, it is automatically set to paused. As for you, this should be just fine, but if you don't want to add it as a child, I decided to use the
objective c functions scheduling.
To schedule:
[[CCScheduler sharedScheduler] scheduleSelector:@selector(tick:) forTarget:self interval:0.0 paused:NO];
To unschedule
[[CCScheduler sharedScheduler] unscheduleSelector:@selector(tick:) forTarget:self];
相关文章推荐
- Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is
- 关于ExtJS-4.0.2a中在gridpanel中出现column.getEditor is not a function的错误解决方法
- html.replace is not a function
- 打开页面后调用方法$(function() {});在浏览器控制台出现Uncaught ReferenceError: $ is not defined
- Why the new value is not usable after set PATH in cmd?
- 报错TypeError: $(...).live is not a function解决方法
- The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support.
- animate is not a function(zepto 使用报错)[转]
- Uncaught TypeError: boolean is not a function
- 小程序之坑一TypeError: this.setData is not a function
- The function equals must be used with a prefix when a default namespace is not specified解决
- 关于window.location.href is not a function在FF,chrom报错问题
- $http.get is not a function
- $(...).live is not a function
- jquery版本更新后无live函数的处理.TypeError: $(...).live is not a function
- json数据类型 导致(xxx).ToLowerCase isnot a function
- rvm is not a function的解决方法
- Uncaught TypeError: sum is not a function
- Scriptaculous 中的 "... getStyle is not a function." 错误