Years is really a kill pig knife, flash I have not written a blog for two months, indeed recently did not spend time in development, ready to go to study for a few years, hehe, said really, do programmers really tired, sometimes overtime for income is not proportional to, haha, of course, I do not count to join this ranks, while young see outside the world.
Back to talk about today's theme, in fact, this is not what technical difficulties, is nothing to write something, suffer this period of time not spent in technology, so there is no writing, but happened recently want to write something to play, met this, so there is this article.
I am using the latest 3.3RC0 version of the development, just use the Userdefault class to store some simple small data, but because the program has some problems, so I need to open this saved Userdefault.xml file, in the previous version, are stored in the project \ Proj.win32\debug.win32 folder, so it is easy to find, but this time can not find, I later I see the blind, adjust the change of time to sort the way, no, directly search the XML file, or not, so only debugging to find this directory.
This class file is CCUserDefault.cpp, so the opening you can know how it is implemented, I mainly find how to save the file, which has such a function,
void Userdefault::initxmlfilepath ()
{
if (! _isfilepathinitialized)
{
_filepath + = FileUtils:: GetInstance ()->getwritablepath () + xml_file_name;
_isfilepathinitialized = true;
}
}
Because it is a cross-platform storage solution, so you know, we can print this read-write path to solve. Let's print a little bit.
Log ("%s", Fileutils::getinstance ()->getwritablepath (). C_STR ());
When I see this path, just want to say "hehe" ...
How to find this file in the back I think it will be, in the local directory, there will be its own project folder, open after the XML file will lie quietly there waiting for you. As for why Cocos to change the position, I think I should be able to understand it later. At this point, the problem solved, although only the key to a print statement, I This is nonsense wrote a bunch, haha ~ ~ ~