Re: iPhone: validate a NSString for US zipcode
Re: iPhone: validate a NSString for US zipcode
- Subject: Re: iPhone: validate a NSString for US zipcode
- From: "Eric E. Dolecki" <email@hidden>
- Date: Thu, 7 Jan 2010 16:48:11 -0500
I am using the Yahoo! weather service.
If I send it a zipcode that doesn't resolve to a city location, it does
return a chunk of error XML - so I am using that as my validation now. I put
up an alert notifying that the supplied zipcode doesn't work so another can
be tried. It's not as nice as supplying a city name and choosing from a list
of matches, but it works well enough I guess. I thought about using another
service to validate a zipcode before sending it - but since I get the error
supplied to me I can skip that extra step.
I appreciate all of the feedback I've gotten on this - it's been very
helpful.
On Thu, Jan 7, 2010 at 4:24 PM, Lorenzo Thurman <email@hidden>wrote:
>
>> I've been googling but haven't seen yet how to best validate a 5-digit
>> zipcode for use in the US (without using a webservice).
>>
>> I have the NSString, I just need to validate it. I know zero RegExp, is
>> there a formatter I can use?
>>
>>
>> I actually ran into a similar issue with one of my programs (Weather Vane)
> early on when it only supported US zip codes. I decided to use a free SOAP
> service to validate the zip code since it removed that as a maintenance
> burden. You've received a lot replies with the same suggestion, but
> unfortunately I can't find that service anymore. Everything else out there
> seems fee based. Maybe someone out there can point you to a free service.
> Maybe this question was already asked in one of the earlier replies, but
> I'll ask anyway: What does your application do? Why do YOU need to validate
> the zip? I use accuweather for my forecasts. If my app sends an invalid zip
> code, the query fails; that's my validation.
>
--
http://ericd.net
Interactive design and development
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden