Adam: Would this work even if the two arrays weren't in the same order?
Sincerely, Pierce F -- Pierce Freeman [EMAIL PROTECTED] On 11/28/08 8:35 PM, "Adam R. Maxwell" <[EMAIL PROTECTED]> 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]