pragma mark - 判断字符串为null
-(NSString*)customModel:(NSString *)modelStr{
//判断
if ([modelStr isEqual:[NSNull null]]){
return @" ";
}
else if ([modelStr isKindOfClass:[NSNull class]]){
return @" ";
}
else if (modelStr == nil){
return @" ";
}
else if ([modelStr isEqualToString:@""]||[modelStr isEqualToString:@"<null>"]||[modelStr isEqualToString:@"null"]){
return @" ";
}
else{
return modelStr;
}
}
用法:[self customModel:_model.deviceName]