cocos2d-2.1beta3-x-2.1.0: Ambiguous conversion error in readNodeGraphFromFile("MainLayer.ccbi", this)

I’m getting an ambiguous conversion error when calling readNodeGraphFromFile(see code below). CCScene is derived from CCNode and CCNode is derived from CCObject. So why can’t my MainScene pass this error?

I’m using cocos2d-2.1beta3-x-2.1.0 on Xcode 4.5.2 with CocosBuilder 3.0 Alpha

<— MainScene.h

class MainScene :
public CCScene,
public CCBAnimationManager {

<— MainScene.cpp

bool MainScene::init() {
CCNodeLoaderLibrary ll = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary;
ll~~>registerCCNodeLoader);
cocos2d::extension::CCBReader ccbReader = new cocos2d::extension::CCBReader;
CCNode
node = ccbReader~~>readNodeGraphFromFile;

Error: Ambiguous conversion from derived class ‘MainScene’ to base class ‘cocos2d::CCObject’:
CCNode
node = ccbReader->readNodeGraphFromFile(“MainLayer.ccbi”, this);"

I always cast the result of readNodeGraphFromFile to whatever node type I’m expecting, because it’s possible to have various different types of top-level nodes in the ccb. As to “why” this is required, that’s probably beyond my level of understanding of C++… Sorry! :slight_smile:

Ben

How do you publish your files in the new CocosBuilder version? I get an error “No cocos player”? Do i have to run it? If I need … how?

The solution for my problem: http://www.cocos2d-iphone.org/forum/topic/219769

The solution for my problem: http://www.cocos2d-iphone.org/forum/topic/219769