I have a class ,just name it SubNode, it inherits CCNODE, now i have a class MyClass, MyClass composites subnode, in MyClass deconstructor function, it will release the SubNode, like this: SubNode->release(); it get’s a compile error:‘release is a private member of CCObject’. then i recheck the CCNODE class, there is no release method in it. what can i do to release the SubNode? any help, please?
now i want to cast my subnode to CCOBject to use the release method, how to cast it?
SubNode subnode = SubNode::create();
CCObject* object = dynamic_cast<SubMode*>(subnode);
now i can release it, is it ok to cast it? is there any problem in it?
Maybe you forgot put “public” here?
class SubNode: public CCNode …
……what a stupid question i got!
thanks very much!