Allocating an object of abstract class type in CREATE_FUNC()


#1

Hello,

This works:

class Lobbym : public cocos2d::CCLayer
{
public:

Lobbym();
Lobbym;
\ virtual\ bool\ init;\
\ static\ cocos2d::CCScene*\ scene;
\ void\ menuCloseCallback;
\ CREATE_FUNC;
};

This\ doesn’t\ and\ gives\ the\ error\ noted\ in\ the\ title:
class\ Lobbym\ :\ public\ cocos2d::CCLayer,\ public\ cocos2d::extension::CCTableViewDataSource,\ public\ cocos2d::extension::CCTableViewDelegate
{
public:
\ Lobbym;
Lobbym();

virtual bool init();

static cocos2d::CCScene* scene();

void menuCloseCallback(CCObject* pSender);

CREATE_FUNC(Lobbym);
};

Help?


#2

You should implement pure virtual methods declared in cocos2d::extension::CCTableViewDataSource and cocos2d::extension::CCTableViewDelegate.


#3

Thanks, it worked! :slight_smile: