此方法在与后台得到数据的处理上非常实用,放在blong中,以便随时用
//判断空
static inline BOOL isStringEmpty(NSString *string){
if (string == nil || string == NULL) {
return YES;
}
if ([string isKindOfClass:[NSNull class]]) {
return YES;
}
if ([string isEqualToString:@"<null>"]) {
return YES;
}
if ([string isEqualToString:@"(null)"]) {
return YES;
}
if ([string isEqualToString:@""]) {
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
return YES;
}
return NO;
}