localfilePath = cc.FileUtils:getInstance():fullPathForFilename( FILE_NAME )
三、打开文件
local f = io.open( filePath,"r" )
四、读,decode
local t = f:read( "*all" )
f:close()
if nil ~= t and "" ~= t then local jsonData = cJson.decode( t ) if jsonData == nil then print("Json error") end for k,v in pairs( jsonData ) do print("KKKKKKKKKKKKKKKK = ",v.level,v.xp,v.title ) end else print("data was empty") end