Wednesday, 15 April 2015

ios - How to avoid alphabet and special characters in a UITextfield? -


I have been formatted to a US mobile number Uaiteedefild.
I was displaying number format in the US, but it allows

I do not want to allow alphabet and special characters.
How can I avoid these unwanted characters?

Please give any examples.

Try it

  #define ACCEPTABLE_CHARACTERS @ "Do you want Replace with permission. " - (BOOL) Tekstfild should Tekstfild (UITextField *) Chenjrsctors Inrenj: (Ansarenj) range replacement string: (NSString *) string {NSCharacterSet * cs = [[NSCharacterSet characterSetWithCharactersInString: ACCEPTABLE_CHARACTERS] invertedSet]; NSString * filtered = [[Separated BearActers Inset: String components] componentsJoinedByString: @ ""]; Return [String Extolstration: Filtered];  

}


No comments:

Post a Comment