我在目标C中有两个数组.它们的数据结构如下:
{"index":"1","lastName":"Brown","firstName":"Kathy","company":"ABC inc."}, {"index":"2","lastName":"Smith","firstName":"Mike","company":"XYZ inc."}
和
{"index":"1","make":"Toyota","model":"RAV4","year":"2009"}, {"index":"2","make":"Honda","model":"Pilot","year":"2012"}
我的任务是将这两个数组放入一个json NSData对象中.同时,在json数据中,我应该将名称"People"分配给第一类数组实体,将"Car"分配给第二类数组实体,所以稍后在php端,我应该能够分辨是哪个并将它们分别放入不同的表中.你能帮我找到生成所需json对象的正确方法吗?