- (BOOL)isBlankString:(NSString *)string
{
if (!string)
{
return YES;
}
if ([string isKindOfClass:[NSNull class]])
{
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0)
{
return YES;
}
return NO;
{
if (!string)
{
return YES;
}
if ([string isKindOfClass:[NSNull class]])
{
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0)
{
return YES;
}
return NO;
}
ShenHeYingyeZhiZhaoCell *cell = [self.tableView cellForRowAtIndexPath:_indexPath];
BOOL isOpinionNull = [self isBlankString:cell.opinionTextView.text];
if (!isOpinionNull) {
NSLog(@"++++++++%ld",cell.opinionTextView.text.length);
}
else
{
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"NSnotification" message:@"the Opinion is can't be null" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:nil, nil];
[alertView show];
}
}