NSString *trimedString = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([trimedString length] == 0) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告" message:@"搜索内容不能为空" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
[alert release];
return true;
}
if ([trimedString length] == 0) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告" message:@"搜索内容不能为空" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
[alert release];
return true;
}