iPhone/Xcode not a function

iPhone/Xcode not a function
0.0 0


Hello again,
I made a game based upon the tutorial of raywenderlich.com. Today i tried to make an iPhone application, but I wasn’t able to. I’m using cocos2d-html5 2.1.1 and cocos2d-iphone-2.1 .

The problem is:
My game runs fine in the browser, but when I try it in Xcode it says: this.initWithFile is not a function in my PlayerSprite class.

var PlayerSprite = cc.Sprite.extend({
//… properties …
ctor:function(characterName, scaling){
this.initWithFile(sprite, cc.rect(0,0,31,44));
// …other functions

Am I using an incompatible version of cocos2d-iphone? Am I missing something?

Thank You in advance


There is not problem base on the code what you had provided.

Could you please show me more details or some code that could be reproduced the issue in HelloWorld?


在cocos2d-x javascript中,
var sprite = cc.Sprite.create(image);
sprite 没有 initWithFile方法。