Open jvanlint opened 9 years ago
@jvanlint Hi! It seems like in the first Dashboard tag you have three elements: 1 Name and 2 KPI's; while in the second you have 1 KPI and 1 Name.
The second Dashboard parses to a @{@Name:@"Test Board", @"KPI":@{...}}
dictionary, which sounds fairly reasonable
The first Dashboard, however, has two KPI objects, so they are parsed into an array of dictionaries that you can reference by KPI key. That makes perfect sense as well, since you can't have two distinct objects stored by the same key.
If you want to use consistent keypaths, you should try setting alwaysUseArrays
to YES
so that the second dashboard dictionary will have an array of a single KPI instead of a dictionary under @"KPI"
key.
Hope this helps
Hi Nick,
I have the following XML
I use the [NSDictionary valueForKeyPath] method. The first Dashboard seems to process ok with KPI being a dictionary of 9 key/pair values.
The last KPI does not however and just appears to be an array of 9 key/pair values.
Here is an image illustrating what I mean.
Any ideas? Is it a bug or something I am not understanding? Why is it treating the 2nd dashboard KPI differently just because it is alone?