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: Paul Bruneau <email@hidden>
- Date: Thu, 7 Jan 2010 13:00:27 -0500
On Jan 7, 2010, at 12:29 PM, David Duncan wrote:
Given that you would likely want to do this test with a binary
search I don't see any reason why it should be slow (effectively you
can do the entire search with about 17*k compares).
To help make this thread more Cocoa-y, I would like to ask: Do the
NSSet and NSArray methods like -containsObject perform in a fashion
comparable to a home-rolled binary search? I greatly prefer to use the
Cocoa stuff rather than try to remember/learn how to properly code
such things.
Plus, the theory of premature-optimazation-is-bad would say just use
the Cocoa stuff and only if performance is proven to be a problem,
then look at optimizing, wouldn't it?
_______________________________________________
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