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 <lorenzo7...@gmail.com>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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to