If I am going to parse above xml in to dictionary I will get "Item" as an Array. But if there is only single element of "Item" it will be consider as a dictionary. It happen many times when there is a case of getting a single element in array and other time it has multiple elements, e.g location kind of APIs.
How can I manage this case with my objective-c property type? In above case if I take "Item" as NSArray type and in response if I get only single element of "Item" it will be converted to NSDictionary type, and I will get a crash in this case.
Please help me in above scenario and guide me if my understating is not proper.
Hi,
I am facing an issue while parsing an array with single element in XML. Please refer below example for more details.
If I am going to parse above xml in to dictionary I will get "Item" as an Array. But if there is only single element of "Item" it will be consider as a dictionary. It happen many times when there is a case of getting a single element in array and other time it has multiple elements, e.g location kind of APIs.
How can I manage this case with my objective-c property type? In above case if I take "Item" as NSArray type and in response if I get only single element of "Item" it will be converted to NSDictionary type, and I will get a crash in this case.
Please help me in above scenario and guide me if my understating is not proper.