himanth himanth - 1 year ago 52
iOS Question

How to know that my array contains dictionary or not?

I have an array like this

( {
GPSOdometerReading = "11843.6";
"_id" = {
"$oid" = 5656e7175201edbb16a483f4;
acc = 0;

So how to know that my array contains the dictionary or not?


Answer Source

You need to enumurate over array & check class of each object like below

BOOL isContainsDict;

    for (id value in Array){
    if ([value isKindOfClass:[NSDictionary class]])
       isContainsDict = YES;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download