himanth himanth - 1 year ago 36
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;