• 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: Pierce Freeman <email@hidden>
  • Date: Fri, 28 Nov 2008 20:41:21 -0800
  • Thread-topic: Checking One Array Against Another

Adam:

Would this work even if the two arrays weren't in the same order?


Sincerely,

Pierce F

--
Pierce Freeman
email@hidden




On 11/28/08 8:35 PM, "Adam R. Maxwell" <email@hidden> wrote:

>
> On Nov 28, 2008, at 8:25 PM, Pierce Freeman wrote:
>
>> Hi everyone.
>>
>> I am attempting to check one array's contents against another's, but
>> so far
>> it hasn't been working.  In the actual application, I am checking the
>> current open applications against an "okay" application list, and just
>> thought of another problem:  If the user doesn't have an application
>> open
>> that is on the list, it will think the reverse. Some example code
>> (with
>> different variables) is below:
>
> Have you considered using NSSet for this?
>
> NSSet *openSet = [NSSet setWithArray:openApplications];
> NSSet *allowedSet = [NSSet setWithArray:allowedApplications];
>
> if ([openSet isSubsetOfSet:allowedSet])
>      // do something
>
> --
> Adam


_______________________________________________

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: Checking One Array Against Another
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Checking One Array Against Another
  • Next by Date: Re: analysing image to find blobs
  • Previous by thread: Checking One Array Against Another
  • Next by thread: Re: Checking One Array Against Another
  • Index(es):
    • Date
    • Thread