首页 > 其他 > 详细

cocos2d-x3.0 用CCDictionary写文件

时间:2014-05-27 23:48:00      阅读:603      评论:0      收藏:0      [点我收藏+]


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写文件

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!