直接用tinyxml2的loadFile,加載一個XML文件,在WIN PC下是能夠的,但在真機下失敗。xml
const char* filepath = "test.xml";get
tinyxml2::XMLDocument* xmlfile = new tinyxml2::XMLDocument();test
auto ret = xmlfile->loadFile(filepath); //這裏失敗file
修正:文件
const char* filepath = "test.xml";co
tinyxml2::XMLDocument* xmlfile = new tinyxml2::XMLDocument();new
auto content = CCFileUtils::getInstance()->getDataFromFile(filepath);path
auto ret = xmlfile->Parse((const char*)content.getBytes(), content.getSize());const