+ (NSString *)pal_excludeNil:(NSString *)str{
if ([str isKindOfClass:[NSString class]]) {
if (str !=nil &&
![str isEqualToString:@"(null)"] &&
![str isEqualToString:@""] &&
![str isEqualToString:@"<null>"]){
return str;
}else{
return @"";
}
}else if([str isKindOfClass:[NSNumber class]]){
return [NSString stringWithFormat:@"%@",str];
}else{
return @"";
}
}
+ (BOOL)isValidOfDictionary:(NSDictionary *)dictionary
{
if (!dictionary || [dictionary isKindOfClass:[NSNull class]] || ![dictionary isKindOfClass:[NSDictionary class]] || dictionary.count <= 0) {
return NO;
};
return YES;
}
网友评论