如何验证UITextField的内容?
问题描述:
我有一个问题,当我从UITeField到PHP发布的文字,如果我留一个空格,或者使用奇怪的符号(即!,@,#^,&,{} ...)如何验证UITextField的内容?
我可以阻止IBaction不发送这个无用的文本到服务器?
- (IBAction)sendeTextToServer:(id)sender{
if(textfield.text has any space or other symbols inside){
//Block the text send to server
}
else
//Send the text to server to do something.
}
如何验证UITextField的内容?
参见:http://stackoverflow.com/questions/5393377/objective-c-regex-format-creditcard – magma 2011-04-18 03:07:14
感谢,现在我期待这个页面,还是尽量理解现在 – 2011-04-18 03:08:10
和:HTTP:// www.codinghorror.com/blog/2008/06/regular-expressions-now-you-have-two-problems.html – magma 2011-04-18 03:09:46