嗨我收到以下JSON作爲響應,但在嘗試將其解析爲NSArray時出現錯誤。iOS:JSON解析到NSArray?
NSArray * resp = [JSON objectForKey @「CONVCOLL」];
它拋出上述行異常。請幫助
(
{
ACT1 = "<null>";
ACT2 = "<null>";
AUTRECERTI = "<null>";
AUTRESTI = "<null>";
CONVCOLL = "CCT romande du second oeuvre";
DESCPHILO = "<null>";
DESCSUCC = "<null>";
DIRECTION = "M. Aldo Zoppi, chef d'entreprise";
DISPHYGSEC = 1;
FILIALES = "<null>";
ISO14000 = 0;
ISO9000 = 0;
ZONEACT = "La Riviera, Lavaux et Lausanne";
},
{
ACT1 = "<null>";
ACT2 = "<null>";
AUTRECERTI = "<null>";
AUTRESTI = "<null>";
CONVCOLL = "<null>";
DESCPHILO = "<null>";
DESCSUCC = "<null>";
DIRECTION = "<null>";
DISPHYGSEC = 0;
FILIALES = "<null>";
ISO14000 = 2;
ISO9000 = 1;
ZONEACT = "<null>";
},
{
ACT1 = "<null>";
ACT2 = "Volets en aluminium";
AUTRECERTI = "<null>";
AUTRESTI = "<null>";
CONVCOLL = "<null>";
DESCPHILO = "<null>";
DESCSUCC = "<null>";
DIRECTION = "M. Denis Zurbuchen, directeur et M. Jacques Zurbuchen, directeur d'exploitation";
DISPHYGSEC = 1;
FILIALES = "<null>";
ISO14000 = 0;
ISO9000 = 0;
ZONEACT = "<null>";
}
)
它看起來像你的JSON是一個JSONArray,而不是JSONObject,通過JSONObjects的JSONArray循環,並在每個JSONOBj等等,在上面打電話。 – wottle 2014-08-28 12:38:07
閱讀(幷包含)例外消息或其他錯誤症狀。 – user2864740 2014-08-28 12:40:49
-1不包括確切的異常消息。 (但人們可以猜到它就像是「無法識別的選擇器」 - 最外層的「層」是一個數組,而不是字典)。 – 2014-08-28 12:42:47