dchohfi / KeyValueObjectMapping

Automatic KeyValue Object Mapping for Objective-C, parse JSON/plist/Dictionary automatically
http://dchohfi.com/
MIT License
600 stars 90 forks source link

Handling unexpected json data #8

Open laptobbe opened 12 years ago

laptobbe commented 12 years ago

Sometimes the json data type and the type in the model does not match. For example something you expect to be an array is a string. In these cases the parsing should have a error parameter, so that we can get a sensable error if that happens.

dchohfi commented 12 years ago

Good to know and nice idea, good if I pass the NSError as an attribute? So the "normal" method keep simpler. Btw, going to implement that on the next week, or send me a pull request, would be nice! :)

Also, I might implement something to parse values using blocks, so anyone can implement some different rule. How about?

laptobbe commented 12 years ago

Blocks seems nice :), I can work on a pull request for the error passing.

Tobias Sundstrand 070-931 07 86

31 aug 2012 kl. 22:47 skrev Diego Chohfi notifications@github.com:

Good to know and nice idea, good if I pass the NSError as an attribute? So the "normal" method keep simpler. Btw, going to implement that on the next week, or send me a pull request, would be nice! :)

Also, I might implement something to parse values using blocks, so anyone can implement some different rule. How about?

— Reply to this email directly or view it on GitHubhttps://github.com/dchohfi/KeyValueObjectMapping/issues/8#issuecomment-8204557.

dchohfi commented 12 years ago

I would like to see a pull request :D with tests :P