我需要解析一個活動提要,但每個數組都沒有括號,所以我有點困惑。這也是有效的JSON,因爲我使用在線服務進行檢查。我想指定上下文,然後獲取數據。有誰知道我該如何做到這一點,以及可能的背景是什麼?解析數組周圍沒有方括號的JSON
在這種情況下,我想要「名稱」,「競爭對手」和其他一些領域。任何幫助感激地收到。
{
"604377": {
"competitors": {
"3521278": {
"Name": "Brazil",
"Jockey": null,
"Weight": null,
"Saddle": 0,
"Barrier": null,
"QLDWin": 0,
"VICWin": 0,
"NSWWin": 0,
"QLDPlace": 0,
"VICPlace": 0,
"NSWPlace": 0,
"DetailedPricing": {
"winTotePlus": false,
"placeTotePlus": false,
"topFluc": false,
"bestOfBest": false,
"bestOrSP": false,
"fixedOdds": false,
"fixedWin": true,
"doubleFixedWin": 0,
"bestOfEverythingWin": 0,
"bestAnytimeWin": 0,
"fixedPlace": true,
"startPriceGuarantee": 0,
"fixedEachWay": true,
"placePrices": [
0
],
"startPrice": false,
"internationalStartPrice": false,
"midToteWin": false,
"midTotePlace": true,
"topToteWin": true,
"topTotePlace": false,
"top2ToteWin": false,
"top2TotePlace": false,
"vicToteWinPlus1": false,
"vicTotePlacePlus1": false,
"vicToteWinPlus2": false,
"vicTotePlacePlus2": false,
"vicToteWinPlus5": false,
"vicTotePlacePlus5": false,
"vicToteWinPlus10": false,
"vicTotePlacePlus10": false,
"exoticBet": true,
"exoticMidTote": false,
"exoticBest2Tote": false,
"exoticBest3Tote": false,
"pickYourOdds": false,
"firstfour": true,
"midToteWinPrice": 0,
"midTotePlacePrice": 0,
"topToteWinPrice": 0,
"top2ToteWinPrice": 0,
"top2ToteOrSPWinPrice": 0,
"vicToteWinPlus1Price": 0,
"vicToteWinPlus2Price": 0,
"vicToteWinPlus5Price": 0,
"vicToteWinPlus10Price": 0,
"topTotePlacePrice": 0,
"top2TotePlacePrice": 0,
"vicTotePlacePlus1Price": 0,
"vicTotePlacePlus2Price": 0,
"vicTotePlacePlus5Price": 0,
"vicTotePlacePlus10Price": 0,
"topFlucPrice": 0,
"lastFlucPrice": 0,
"bestOfBestPrice": 0,
"bestOrSPPrice": 0,
"bestOrSPPlacePrice": 0.75,
"winDeduction": 0,
"placeDeduction": 0,
"competitor": 11863763,
"sport": "Soccer",
"saddle": 0,
"description": "Brazil 2014 - World Cup Winner ",
"team": "Jordan",
"win": 0,
"place": 0,
"numOutcomes": 24,
"numPlacings": 1,
"numWinners": 1
},
"Scratched": "no",
"RisaSilkID": null
},
"3521279": {
"Name": "Argentina",
"Jockey": null,
"Weight": null,
"Saddle": 0,
"Barrier": null,
"QLDWin": 0,
"VICWin": 0,
"NSWWin": 0,
"QLDPlace": 0,
"VICPlace": 0,
"NSWPlace": 0,
"DetailedPricing": {
"winTotePlus": false,
"placeTotePlus": false,
"topFluc": false,
"bestOfBest": false,
"bestOrSP": false,
"fixedOdds": false,
"fixedWin": true,
"doubleFixedWin": 0,
"bestOfEverythingWin": 0,
"bestAnytimeWin": 0,
"fixedPlace": true,
"startPriceGuarantee": 0,
"fixedEachWay": true,
"placePrices": [
0
],
"startPrice": false,
"internationalStartPrice": false,
"midToteWin": false,
"midTotePlace": true,
"topToteWin": true,
"topTotePlace": false,
"top2ToteWin": false,
"top2TotePlace": false,
"vicToteWinPlus1": false,
"vicTotePlacePlus1": false,
"vicToteWinPlus2": false,
"vicTotePlacePlus2": false,
"vicToteWinPlus5": false,
"vicTotePlacePlus5": false,
"vicToteWinPlus10": false,
"vicTotePlacePlus10": false,
"exoticBet": true,
"exoticMidTote": false,
"exoticBest2Tote": false,
"exoticBest3Tote": false,
"pickYourOdds": false,
"firstfour": true,
"midToteWinPrice": 0,
"midTotePlacePrice": 0,
"topToteWinPrice": 0,
"top2ToteWinPrice": 0,
"top2ToteOrSPWinPrice": 0,
"vicToteWinPlus1Price": 0,
"vicToteWinPlus2Price": 0,
"vicToteWinPlus5Price": 0,
"vicToteWinPlus10Price": 0,
"topTotePlacePrice": 0,
"top2TotePlacePrice": 0,
"vicTotePlacePlus1Price": 0,
"vicTotePlacePlus2Price": 0,
"vicTotePlacePlus5Price": 0,
"vicTotePlacePlus10Price": 0,
"topFlucPrice": 0,
"lastFlucPrice": 0,
"bestOfBestPrice": 0,
"bestOrSPPrice": 0,
"bestOrSPPlacePrice": 0.75,
"winDeduction": 0,
"placeDeduction": 0,
"competitor": 11863763,
"sport": "Soccer",
"saddle": 0,
"description": "Brazil 2014 - World Cup Winner ",
"team": "Jordan",
"win": 0,
"place": 0,
"numOutcomes": 24,
"numPlacings": 1,
"numWinners": 1
},
"Scratched": "no",
"RisaSilkID": null
},
"3521280": {
"Name": "Spain",
你是對的,沒有陣列!那些是字典!你想用哪種語言來解析它?在Objective-C中,它就像'NSDictionary * jsonDictionary = [NSJSONSerialisation JSONObjectWithData:yourDownloadedData options:kNilOptions error:NULL];'一樣簡單。傳遞NULL不是很好的做法,所以你可能想把它改爲'NSError **';) – HAS