UITextField Questions

2011-07-25 Thread Brooke Gravitt
Hello, I have a question about UITextField - How might I restrict/correct user input that is numerical? For instance, I would like the input to only be numbers, and to have an upper bounds. If a user inputs any non-numerical input, I want to send a message to the UITextField to set itself

Re: UITextField Questions

2011-07-25 Thread Brooke Gravitt
On Mon, Jul 25, 2011 at 9:19 PM, Conrad Shultz wrote: > Take a look at UITextInputTraits to specify a numeric keyboard. (IIRC this > can be done in IB too.) > > Take a look at UITextFieldDelegate's textFieldShouldEndEditing: method to > perform validation of input. > > I should also point out th

Re: UITextField Questions

2011-07-25 Thread Brooke Gravitt
On Mon, Jul 25, 2011 at 10:29 PM, Howard Siegel wrote: > Brooke, > > You would likely be much better off using UIPickerViews, or a UIPickerView > and a UISlider as Conrad suggests. If the UISlider doesn't give you enough > selection precision, then use another UIPickerView. You use the UITextField

Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
How do you prevent an NSTextField from accepting anything aside from numbers? Or will I need to code up a solution to remove text from the field automatically? Display a dialog & clear the contents? Thanks, Brooke ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 11:07 AM, I. Savant wrote: > See NSNumberFormatter. Thanks for the RTFM. It looks like you can no longer get an NSNumberFormatter from the Views pane in Interface Builder & wire it up as was ( recent? ) convention. Is there still a way to do this? I'm not even sure how

Re: Cocoa-dev Digest, Vol 6, Issue 124

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 12:44 PM, Peter Hudson wrote: > In IB in the Library panel, just below half way down there is a symbol > on the left hand side which is a dollar sign ( and a calendar symbol > next to it ) which is the number formatter. Click this and drag it > to the text field - and d

Re: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 2:58 PM, Andy Lee wrote: > 3.1.2. But Alex Kac just posted a relevant note... I had no idea IB was > different for the iPhone/Touch. > > --Andy The good news is I'm not a *complete* idiot, as it appears the option just isn't there for the iPhone/iTouch. Bad news is I *s

Re: Number Formatter

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 3:04 PM, Alex Kac wrote: > Check the Numbers only flag in the IB palette. > So my options are ( if I'm looking in the right place ) on the Text Field Attributes tab on the inspector, Text Input Traits panel Keyboard Type: Default ASCII Capable

Re: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 3:31 PM, Nick Zitzmann wrote: > > You could always attach the formatter manually, like this: (written in Mail, > untested, use at your own risk, and all that) > > - (void)awakeFromNib > { >NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init] > autoreleas

Re: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, 21 Jan 2009 14:56:34 -0600 Alex Kac wrote: > Use the delegate I gave you and format it there. UITextField does not > accept formatters. Look at the docs - all the answers are right there. > Here is how I do it: > > Type in the class in the dev doc window. Set it to only show the > iPhone O

NSDecimalNumber & NSString question

2008-11-18 Thread Brooke Gravitt
Hello, I'm trying to better acquainted with Cocoa and Obj-C, having some trouble with simple things. Perhaps someone could kindly apply cluebat to skull for me. I'm accepting a couple of string values from a pair of NSTextField and would like to take these values and do some math with them, then