Re: Validating form input w/o core data

2011-09-28 Thread Graham Cox
On 28/09/2011, at 11:41 AM, William Squires wrote: Is there a general way of validating the contents of a field before it resigns first responder status? The preferred, supported way is to use a NSFormatter attached to the field. This has the ability to fully constrain and convert values

Re: Validating form input w/o core data

2011-09-28 Thread Lee Ann Rucker
On Sep 27, 2011, at 6:41 PM, William Squires wrote: Hi, I have a need for a complex data-entry form (window). Some fields are supposed to only accept alpha characters (upper or lower), some are supposed to only take integers, others to only take floats (but no negative values allowed).

Re: Validating form input w/o core data

2011-09-28 Thread Andre Masse
You can use formatters for this too. Here's the code I'm using (modify the characters you need to allow in addCharactersInString:). // allow only digits and +-*/. - (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr

Re: Validating form input w/o core data

2011-09-28 Thread Andre Masse
It's in NSFormatter. You just override it in your subclass. Cheers, Andre Masse William Squires mailto:wsqui...@satx.rr.com September 28, 2011 20:48 Okay, but where does the code go? Is this a delegate method

Validating form input w/o core data

2011-09-27 Thread William Squires
Hi, I have a need for a complex data-entry form (window). Some fields are supposed to only accept alpha characters (upper or lower), some are supposed to only take integers, others to only take floats (but no negative values allowed). Is there a general way of validating the contents of a