自己写的解析工具,一个html页面,直接复制到本地就行了,感觉用着还行,留着给大家看看
<!DOCTYPE html>
<html>
<body>
<textarea id="area" style="width:600px; height:400px;"></textarea><br>
<button οnclick="myFunction()">点击这里</button>
<p id="demo"></p>
<script type="text/javascript">
function myFunction()
{
var x;
var txt="";
var text = document.getElementById("area").value;
var person= JSON.parse(text);
for (x in person)
{
var type = Object.prototype.toString.call(person[x]);
if(type == '[object Array]'){
txt= txt + "@property (nonatomic,strong) NSArray *" + x + ";" +"<br>";
}else if(type == '[object Object]'){
txt= txt + "@property (nonatomic,strong) NSDictionary *" + x + ";" +"<br>";
}else{
txt= txt + "@property (nonatomic,copy) NSString *" + x + ";" +"<br>";
}
}
document.getElementById("demo").innerHTML=txt;
}
</script>
</body>
</html>