Charles Yeung Charles Yeung - 5 months ago 10
Objective-C Question

Check whether an object is an NSArray or NSDictionary

As per subject, how can I check whether an object is an NSArray or NSDictionary?

Answer
if([obj isKindOfClass:[NSArray class]]){
    //Is array
}else if([obj isKindOfClass:[NSDictionary class]]){
    //is dictionary
}else{
    //is something else
}