In a textfield I should write a number: this number can be with point (10.23) or without poin (10); but I should to check that this number is a number and not a word. Can I check if in a textfield there is a number instead a word?
Example: if I write a word instead a number I want an nslog that say that there is an error.
In a textfield I should write a number: this number can be with point
Share
Another way:
Also remember that you can use
textField.keyboardType = UIKeyboardTypeNumberPad;for the keyboard. (This won’t guarantee only numeric entries, however, it’s just about user friendliness.)