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

Fixes #92 - check parent object class when looking up DCArrayMapping #97

Closed mungler closed 1 year ago

mungler commented 2 years ago

This fixes https://github.com/dchohfi/KeyValueObjectMapping/issues/92

If you have more than one DCArrayMapping implementation which uses the same key/attribute names, without this patch its pot luck which one you will get at runtime (likely the first one added).

This patch enforces a check to ensure the array mapper is one added for the parent object class of the array field being mapped.

(Repost of earlier PR: https://github.com/dchohfi/KeyValueObjectMapping/pull/93 - closed due to branch finagling)