星空网 > 软件开发 > 操作系统

【代码笔记】判断textField里面是否有空

一,效果图。

【代码笔记】判断textField里面是否有空images/loading.gif' data-original="http://images2015.cnblogs.com/blog/337518/201510/337518-20151019154120520-465589141.jpg" width="218" height="400" />

二,工程图。

【代码笔记】判断textField里面是否有空

三,代码。

ViewController.m

【代码笔记】判断textField里面是否有空
- (void)viewDidLoad {  [super viewDidLoad];  // Do any additional setup after loading the view, typically from a nib.    //TextField  UITextField *textField=[[UITextField alloc]initWithFrame:CGRectMake(20, 100, 100, 200)];  textField.backgroundColor=[UIColor redColor];  textField.text=@"123";  [self.view addSubview:textField];    NSLog(@"判断textField里面是否为空%i",[self textFieldIsNOTEmpt:textField]);    }//判断textField里面是否有空-(BOOL)textFieldIsNOTEmpt:(UITextField *)textField{  if ([textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length!=0){    return YES;  }else {    return NO;  }}
【代码笔记】判断textField里面是否有空

 

 


 

原标题:【代码笔记】判断textField里面是否有空

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

国内寄快递到马来西亚要多少钱:https://www.goluckyvip.com/tag/91248.html
中国寄东西到马来西亚咋收费:https://www.goluckyvip.com/tag/91249.html
往马来西亚寄快递费用:https://www.goluckyvip.com/tag/91250.html
从山东寄快运到马来西亚的价格:https://www.goluckyvip.com/tag/91251.html
往马来西亚发快递多少钱:https://www.goluckyvip.com/tag/91252.html
快递去马来西亚多少钱:https://www.goluckyvip.com/tag/91253.html
长治婚庆女司仪和主持人:https://www.vstour.cn/a/366176.html
北京丰台区水上乐园哪家好玩?:https://www.vstour.cn/a/366177.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流