2

I'm using JSONModel library in my iOS project, I need to manipule an object which is made of arbitrary keys and values.

I didn't find anything about this problem anywhere ... How can I manage to map unknown keys ?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Frntz
  • 2,395
  • 2
  • 16
  • 16

2 Answers2

2

Response I got on Github from sauvikatinnofied :

It is not possible, as the keys are unknown to JSONModel. It will be better if you declare that metadata model as NSDictionary then assess all the values using

for key in [metaDictionary allKeys] {
   NSLog(@"Key: %@: Value: %@", key, metaDictionary[key]);
}
Frntz
  • 2,395
  • 2
  • 16
  • 16
0

If the keys of your json data is unknown or could be anything, you should declare that model as NSDictionary, and use BWJSONMatcher to convert your json string with data models.

Burrows Wang
  • 249
  • 1
  • 7