Using NSNumberFormatter to set rules on textfield

All,
I have a textfield that accepts time in seconds. I want to set 2 rules using the NSNumberFormatter Class:

  1. Set the range 0-59 for the textfield
  2. Ensure that only numerical inputs are supplied.

I’m going through the Xcode documentation and see functions like - setMaximum: and other methods.
I have the property aTimeInput connected to the textfield. How do I use the NSNumberFormatter methods to achieve the 2 rules?

You want an NSDateFormatter, I suspect.

I wanted to use NSNumberFormatter class to do this as I will be adding other textfields which will have different numerical requirements. I haven’t used NSNumberFormatter Class before and it seems to be quite handy . I see that the Object Library has a ‘TextField with Number Formatter’ option. I added this to my app . I don’t know how to set the range.

Click on the field in the sidebar to the left of the editing area, click on its disclosure triangle, then do the same for the cell until you get to the formatter. Then got to the Attributes inspector and set the limits.

Thanks Shane