I have got the following class called ‘Ground’:
.h file
class Ground : public cocos2d::CCNode
{
protected:
//Some variables here...
public:
Ground():_drawings(NULL) {};
CC_SYNTHESIZE(cocos2d::CCSprite *, _drawings, Drawings); *// COMPILE ERROR HERE: 'cocos2d::CCSprite* Ground::_drawings' is protected*
LAYER_NODE_FUNC(Ground);
//Some methods here...
};
And another class called Main:
.h file:
class Main : public cocos2d::CCLayerColor
{
protected:
Ground * _ground;
//Some other variables here...
public:
//Some methods here...
};
.m file:
CCSprite *drawings = ....
_ground->_drawings = drawings; *// COMPILE ERROR HERE: _drawings is a protected member of 'Ground'*
I don’t understand where I am wrong… Why does the compilator tells me that _drawings is protected ?
Thanks for your help !