//该方法是检查字典中是否有nil 的,有nil就转行成""
- (NSDictionary *)checkDict:(NSDictionary *)sender
{
NSMutableDictionary * dict_mutable = [[NSMutableDictionary alloc] init];
NSArray * keys = sender.allKeys;
for (NSString * key in keys) {
if ([[sender objectForKey:key] isKindOfClass:[NSDictionary class]]) {
NSDictionary * tempDict = [self checkDict:[sender objectForKey:key]];
[dict_mutable setObject:tempDict forKey:key];
}
else{
if ([[sender objectForKey:key] isKindOfClass:[[NSNull null] class]]) {
[dict_mutable setObject:@"" forKey:key];
}
else{
[dict_mutable setObject:[sender objectForKey:key] forKey:key];
}
}
}
return dict_mutable;
}