How to parse such a JSON using JSONModel ?
[{
"Value": "Cat",
"Id": 1
}, {
"Value": "Dog",
"Id": 2
}, {
"Value": "Elephant",
"Id": 3
}]
if there was something like this:
{
animals: [{
"Value": "Cat",
"Id": 1
}, {
"Value": "Dog",
"Id": 2
}, {
"Value": "Elephant",
"Id": 3
}]
}
There would be no problem. I would just use:
@property (strong, nonatomic) NSArray <AnimalModel> *animalsArray;
But what can I do if i don't have the "animals" key in the JSON file?