如何处理以下数据

时间:2016-04-19 02:44:27

标签: ios iphone json

我面临的问题是什么..当我在dictionyy中传递像数组一样的值时..它向我显示错误-1005连接丢失了...当我没有传递值时,响应成功创建但在服务器端数据库的ofiice价格详细信息和办公室联系信息和办公文档不保存..任何人帮助我如何处理提前感谢

 [
   {
 "OfficePrice": [
  {
    "office": 1,
    "making_charge": 1,
    "wastage": 1,
    "weight_by": 1,
    "credit_period": 1,
    "cartage_price_type": null,
    "cartage_price": null,
    "diamond_price": 1,
    "amethyst_price": 1,
    "amber_price": 1,
    "sapphire_price": 1,
    "emerald_price": null,
    "ruby_price": null,
    "id": 1,
    "createdAt": "2016-04-15T08:41:08.000Z",
    "updatedAt": "2016-04-16T14:18:39.000Z"
  }
],
"OfficeContactPerson": [
  {
    "office": 1,
    "contact_name": null,
    "designation": "ASDF",
    "department": "234",
    "mobile": "1231231231",
    "email": null,
    "incharge_status": null,
    "created_by": null,
    "modified_by": null,
    "id": 1,
    "createdAt": "2016-04-15T08:41:08.000Z",
    "updatedAt": "2016-04-16T14:18:39.000Z"
  },
  {
    "office": 1,
    "contact_name": null,
    "designation": "ASDF",
    "department": "ASDF",
    "mobile": "1231231231",
    "email": null,
    "incharge_status": null,
    "created_by": null,
    "modified_by": null,
    "id": 2,
    "createdAt": "2016-04-15T08:41:08.000Z",
    "updatedAt": "2016-04-16T14:18:39.000Z"
  }
],
"OfficeBank": [
  {
    "office": 1,
    "bank": 2,
    "branch": null,
    "city": null,
    "account_type": 1,
    "ifsc_code": "12123",
    "account_number": "12234",
    "account_name": "asdfasd",
    "id": 3,
    "createdAt": "2016-04-16T14:18:39.000Z",
    "updatedAt": "2016-04-16T14:18:39.000Z"
  }
],
"OfficeDocument": [
  {
    "office": 1,
    "document_original": null,
    "document_stored_name": null,
    "id": 1,
    "createdAt": "2016-04-15T08:41:08.000Z",
    "updatedAt": "2016-04-16T14:18:39.000Z"
  }
],
"city": {
  "name": "Bengalore",
  "id": 1,
  "createdAt": null,
  "updatedAt": "2016-04-16T16:02:53.000Z"
},
"state": {
  "name": "Karnataga",
  "id": 1,
  "createdAt": null,
  "updatedAt": "2016-04-16T16:02:53.000Z"
},
"district": {
  "name": "BGL",
  "id": 1,
  "createdAt": null,
  "updatedAt": "2016-04-16T16:02:53.000Z"
},
"name": "kkk",
"short_name": "asdf",
"shop_no": "1",
"door_no": "11",
"floor": "1",
"building": "1",
"street": "1",
"area": "1",
"main": "1",
"pincode": "1",
"telephone": "1",
"hallmarking": null,
"payment_by": null,
"delivered_to": null,
"active_status": null,
"delete_status": null,
"created_by": null,
"modified_by": null,
"office_photo_original": null,
"office_photo_stored_name": null,
"cin_path": null,
"vat": null,
"pan": null,
"others": "123123",
"id": 1,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
 }

2 个答案:

答案 0 :(得分:0)

字典无法保存空值。

答案 1 :(得分:0)

NSDictionay格式不支持null值。这就是为什么它的返回错误。 唯一可能的解决方案是更新服务器数据库,将空值更改为0或“NULL”(双引号)。它会解决你的问题。