码迷,mamicode.com
首页 > 其他好文 > 详细

cocos2d-x3.0 用CCDictionary写文件

时间:2014-05-27 23:47:44      阅读:443      评论:0      收藏:0      [点我收藏+]

标签:style   c   class   a   int   get   


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;
}

cocos2d-x3.0 用CCDictionary写文件,布布扣,bubuko.com

cocos2d-x3.0 用CCDictionary写文件

标签:style   c   class   a   int   get   

原文地址:http://www.cnblogs.com/mengfanrong/p/3753920.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!