Migration code to cocos2d-x 2.0.1 to cocos2d-x 2.0.2

Migration code to cocos2d-x 2.0.1 to cocos2d-x 2.0.2
0.0 0


I begin to migrate my code to new cocos2d-x 2.0.2 because I want to use CCEditBox, CCHttpRequest and multi-resolution support

The first problem is

CCMenuItemToggle::create(   this,
            CCMenuItemFont::create( "On" ),
            CCMenuItemFont::create( "Off"),
            NULL );

I receive this error
no matching function for call to ‘cocos2d::CCMenuItemToggle::create(OptionsScene* const, void (cocos2d::CCObject::), cocos2d::CCMenuItemFont, cocos2d::CCMenuItemFont*, NULL)’
The second is

laughAnim = CCAnimation::create(arrayOfSpriteLaugh,0.1);

I receive this error
error: no matching function for call to ‘cocos2d::CCAnimation::create(cocos2d::CCArray*&, double)’

how I can correct this?

ps: with the new Iphone 5 release(that has a 4.0" screen), it will make more headache to implement multi-resolution support, since it’s not 960x640 pixels.


questions 1

Please check the interfaces in CCMenuItem.h

/** creates a menu item with no target/selector and no items */
static CCMenuItemToggle* create();

/** creates a menu item with a item */
static CCMenuItemToggle* create(CCMenuItem *item);

/** creates a menu item from a list of items with a target/selector */
static CCMenuItemToggle* createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); 

As you can see, what you want is createWithTarget

question 2

The same please check header files when you meet such problems.
I guess you’re looking for

static CCAnimation* createWithSpriteFrames(CCArray* arrayOfSpriteFrameNames, float delay = 0.0f);


Thanks for the help.
The next time I’ll look for the headers, thanks.