Hi everybody !
I have a problem when upgrade to cocos2d-x 3.0.
This is my XmlReader class and my string.xml
EGXMLReader.h
class EGXMLReader {
private:
CCDictionary* m_dictionary;
public:
EGXMLReader(const char* dicFilename);
~EGXMLReader();
const char* GetStringByKey(const char* keyword);
static const char* GetStringByKeyFromFile(const char* dicFilename, const char* keyword);
};
EGXMLReader.cpp
EGXMLReader::EGXMLReader(const char* dicFilename) {
this->m_dictionary = CCDictionary::createWithContentsOfFile(dicFilename);
}
EGXMLReader::~EGXMLReader() {
}
const char* EGXMLReader::GetStringByKey(const char* keyword) {
return ((CCString*)(this->m_dictionary->objectForKey(keyword)))->getCString();
}
const char* EGXMLReader::GetStringByKeyFromFile(const char* dicFilename, const char* keyword) {
CCDictionary *dictionary = CCDictionary::createWithContentsOfFile(dicFilename);
return ((CCString*)dictionary->objectForKey(keyword))->getCString();
}
string.xml
abc // If like this it’s report Assert failed: key not found : <integer/real>
abcabc // else it’s report this dictionary does not use string as key.
Someone help me. I don’t know what i wrong