Cocos2d-x游戏开发之jsoncppdemo

	//json解析,使用jsoncpp

	CSJson::Reader reader;
	CSJson::Value root;
	if (reader.parse(resData,root)) {
		int count = root.size();
		cclog("count:%d",count);
		
		for (int i = 0; i < count; i++) {//使用int,否则size_t在mac在重载报错
			CSJson::Value temp = root[i];
			int id = temp["id"].asInt();
			string title = temp["title"].asstring();
			
			string thumb = temp["thumb"].asstring();
			getimageFromServer(thumb);

			string url = temp["url"].asstring();
			cclog("id: %d title:%s thumb:%s url:%s",id,title.c_str(),thumb.c_str(),url.c_str());
		}
	}

相关文章

    本文实践自 RayWenderlich、Ali Hafizji 的文章《...
Cocos-code-ide使用入门学习地点:杭州滨江邮箱:appdevzw@1...
第一次開始用手游引擎挺激动!!!进入正题。下载资源1:从C...
    Cocos2d-x是一款强大的基于OpenGLES的跨平台游戏开发...
1.  来源 QuickV3sample项目中的2048样例游戏,以及最近《...
   Cocos2d-x3.x已经支持使用CMake来进行构建了,这里尝试...