Charles Yeung Charles Yeung - 2 years ago 70
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 Source
if([obj isKindOfClass:[NSArray class]]){
    //Is array
}else if([obj isKindOfClass:[NSDictionary class]]){
    //is dictionary
}else{
    //is something else
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download