static inline BOOL DSIsObjNull(id obj)
{
return obj == nil ||
([obj isEqual:[NSNull null]]) ||
([obj respondsToSelector:@selector(length)] && [(NSData *)obj length] == 0) ||
([obj respondsToSelector:@selector(count)] && [(NSArray *)obj count] == 0);
}
static inline BOOL DSIsStringNull(NSString *string)
{
if (string == nil)
{
return YES;
}
if (string.length == 0)
{
return YES;
}
if ([string isEqualToString:@"<null>"])
{
return YES;
}
if ([string isEqualToString:@"(null)"])
{
return YES;
}
return NO;
}
网友评论