• 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: "Sean McBride" <email@hidden>
  • Date: Thu, 7 Jan 2010 16:57:57 -0500
  • Organization: Rogue Research Inc.

On 1/7/10 1:44 PM, David Duncan said:

>> 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.
>
>Since NSArray is unordered I would not expect its containsObject to do
>better than O(n). If NSSet is an ordered container, it should be able to
>do O(lg n). I don't believe we give any guarantees as to performance of
>these methods however, but a simple implementation of either data
>structure would likely give you these performance characteristics.

CFArray.h does discuss performance.  And there exists a
CFArrayBSearchValues().

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

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>)
 >Re: iPhone: validate a NSString for US zipcode (From: Paul Bruneau <email@hidden>)
 >Re: iPhone: validate a NSString for US zipcode (From: David Duncan <email@hidden>)

  • Prev by Date: Re: iPhone: validate a NSString for US zipcode
  • Next by Date: Re: A password strength checker
  • 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