I have a couple of user definable variables in my app but not sure on the best way to allow these to be configured.
Currently trying to this using a UITextField with the keyboard set to 'number pad' mode, but I can't see how to trap the inputed value because there is no return key on this type of keyboard... so what do i do?
I think the only solution is to implement your own numeric keypad that has a decimal point. That really sucks though. Or I wonder if it would be possible to use the exiting NumerPad and overlay a button with a decimal point on it in the lower left corner?
What I did is use the normal keyboard but in the text field delegate method 'textField:shouldChangeCharactersInRange:replaceme ntString:' I return NO if the replacement string contains invalid characters (like letters for a number field).
It sucks there is no way to create custom keyboards with just the keys we need so this is what I do until I get the ambition to write from scratch a replacement for the keyboard functionality.
I'm sorry for my ignorance - but where am I supposed to write this piece of code? please about the line of code in a little more detail.
~Thanks in advance.
Like I said, read my first post. I clearly state to add this code in the text field's delegate method. The name of the method is in my first post.
May I politely suggest reading the docs on UITextField and UITextFieldDelegate. That may help out some.
The basic idea is that this delegate method gets called on every button you tap on the keyboard, including the delete key. Just reject invalid values based on the needs of your text field.