• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iPhone: validate a NSString for US zipcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: iPhone: validate a NSString for US zipcode
      • From: James Bucanek <email@hidden>
    • Re: iPhone: validate a NSString for US zipcode
      • From: David Duncan <email@hidden>
References: 
 >iPhone: validate a NSString for US zipcode (From: "Eric E. Dolecki" <email@hidden>)
 >Re: iPhone: validate a NSString for US zipcode (From: Paul Bruneau <email@hidden>)
 >Re: iPhone: validate a NSString for US zipcode (From: "Eric E. Dolecki" <email@hidden>)
 >Re: iPhone: validate a NSString for US zipcode (From: David Duncan <email@hidden>)

  • Prev by Date: Re: wait for sheet result
  • Next by Date: Re: Julian date
  • Previous by thread: Re: iPhone: validate a NSString for US zipcode
  • Next by thread: Re: iPhone: validate a NSString for US zipcode
  • Index(es):
    • Date
    • Thread