my file .plist doesn't not change...

  • Johan08
    Likes 0

    Problem Description

    Hi community !

    Why my file .plist doesn't changed when I wrote in this?

    I work with IDE: visual studio 2012,  version : cocos2d-x-3.2. 

     

     

    __Dictionary * libro = __Dictionary::create();

     

     

                                 //tipo     //valor                   // llave
    libro->setObject(__Integer::create(4), __String::create("KeyNameInt")->getCString());
                      
    libro->setObject(__Float::create(4.67), __String::create("KeyNameFloat")->getCString());

    libro->setObject(__String::create("Hello World"), __String::create("KeyNameString")->getCString());

    libro->setObject(__Bool::create(true), __String::create("KeyNameBool")->getCString());



    auto fileName = __String::create("FileName.plist");

     


    auto filePath = __String::createWithFormat("%s%s", FileUtils::getInstance()->getWritablePath().c_str(), fileName->getCString());

     


    libro->writeToFile(filePath->getCString()) ;

     

     

    myfile FileName.plist in Resources folder :
        
        

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">

    <plist version="1.0">
    <dict>

        <key>KeyNameInt</key>
        <integer></integer>
        
        <key>KeyNameFloat</key>
        <integer></integer>
        

        <key>KeyNameString</key>
        <string>sdfsdf</string>
        
        <key>KeyNameBool</key>
        <false/>

    </dict>
    </plist>


        

     

     

    …… 

    thanks :)

     

     

     

     

     


  • Sonar Systems admin
    Likes 0

    Where is the PLIST, is it in your resources?

  • Johan08
    Likes 0

    yes!,  it is in resources folder ...

  • Sonar Systems admin
    Likes 0

    The saving is for resources saved to the storage on your device at run time.

Login to reply