一,先创建一个字典类别(这样字典可以直接调用,方法名不能与系统方法名重复)
-(id)takeOutKey:(NSString*)str{
if ([[self allKeys]containsObject:str]){
if ([[self objectForKey:str] isKindOfClass:[NSDictionary class]]) {
return[selfobjectForKey:str];
}else if ([[self objectForKey:str] isKindOfClass:[NSArray class]]){
return[selfobjectForKey:str];
}
return [NSString stringWithFormat:@"%@",[self objectForKey:str]];
}
return @"";
}
网友评论