Skip to content

Instantly share code, notes, and snippets.

@bespalown
Last active August 29, 2015 14:00
Show Gist options
  • Save bespalown/11244833 to your computer and use it in GitHub Desktop.
Save bespalown/11244833 to your computer and use it in GitHub Desktop.
Есть Json
EasyMapping не может нормально показать price в sale_points_prices, ну думаю посмотрю как NSDictionary покажет
Написал такую штуку:
NSDictionary* prices = [JSON objectForKey:@"prices"];
NSDictionary* sale_points_prices = [prices objectForKey:@"sale_points_prices"];
//до этого момента все хорошо
NSDictionary* price = [sale_points_prices objectForKey:@"price"];
//тут отваливается
Не могу понять что не так.
{
"id": 53378,
"name": "ФРАНЦУЗСКОЕ ВИНО MARQUIS SAINT-MICHEL, ПОЛУСЛАДКОЕ БЕЛОЕ, 11% ОБ., 0,75 Л",
"description": "",
"barcode": "3343380013305",
"image_url": "http://fair-price.biz/system/images/tovar/main/a5a70352ab632375d56babe8e2d655ef.jpeg",
"thumb_detail_image_url": "http://fair-price.biz/system/images/tovar/main/a5a70352ab632375d56babe8e2d655ef.jpeg",
"amount": "0.750",
"units": "л",
"prices": {
"best": {
"cents": 16999,
"currency": "RUB"
},
"actual": {
"cents": 20729,
"currency": "RUB"
},
"sale_points_prices": [
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
},
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
},
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
},
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
},
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
},
{
"id": 4078,
"title": "Лента",
"address": "проспект Тракторостроителей, д. 76, корп. ",
"lattitude": "56.108000",
"longitude": "47.329196",
"internet_shop": false,
"price": {
"cents": 16999,
"currency": "RUB"
}
}
]
},
"rating": null,
"reviews": [],
"user_data": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment