• 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: Checking One Array Against Another?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking One Array Against Another?


  • Subject: Re: Checking One Array Against Another?
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 29 Nov 2008 17:34:29 -0600

On Nov 28, 2008, at 9:53 PM, Pierce Freeman wrote:

for (int arraySort = 0; arraySort < [arrayInfo count]; arraySort++)
           {
               for (int arrayNewSort = 0; arrayNewSort < [arrayNewInfo
count]; arrayNewSort++)
               {
                   if ([ arrayInfo objectAtIndex:arraySort] ==
[arrayNewInfo objectAtIndex:arrayNewSort])

The above conditional checks for the same object being in both arrays. It doesn't check for two different but equivalent objects being in the two arrays. With strings, you probably want to use isEqualToString: or one of the compare:... methods, instead of the == operator.


Regards,
Ken

_______________________________________________

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: 
 >Checking One Array Against Another? (From: Pierce Freeman <email@hidden>)

  • Prev by Date: Fwd: MVC question
  • Next by Date: Re: reading a PDF
  • Previous by thread: Re: Checking One Array Against Another?
  • Next by thread: analysing image to find blobs
  • Index(es):
    • Date
    • Thread