• cocos2d-x3.0 用CCDictionary写文件



    bool CDownLoad_LocalData::WriteToConfigFile( DownLoadLocalData* downdata ){

    CCDictionary* pDict = CCDictionary::create(); 
    unsigned int lessonid = downdata->lession_id;
    char s_lessonid[10];
    sprintf(s_lessonid,"%d",lessonid);


    CCString* pValue1 = CCString::create(s_lessonid);
    CCString* pValue2 = CCString::create(downdata->fileLocal_path);  
    CCString* pValue3 = CCString::create(downdata->downUrl);  
    pDict->setObject(pValue1, "lessonid");  
    pDict->setObject(pValue2, "fileLocal_path");  
    pDict->setObject(pValue3, "downUrl"); 


    m_total_dict->setObject(pDict,pValue1->getCString());


    if(m_total_dict->writeToFile(m_fileapth.c_str()))//m_fileapth为写文件的路径
    CCLog("Write to file success!");
    return true;
    }
  • 相关阅读:
    Daily Scrum
    Daily Scrum
    Daily Scrum
    Daily Scrum
    Daily Scrum
    bing背单词交互流程
    立会2015-11-23
    每日例会11.16
    每日立会2015-11-11
    单词挑战设计0.1
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/3753920.html
Copyright © 2020-2023  润新知