Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:49:50+00:00 2026-06-07T05:49:50+00:00

I have two NSArrays that I’m comparing — in the NSLog output they look

  • 0

I have two NSArrays that I’m comparing — in the NSLog output they look identical, yet they don’t equal each other somehow. If I convert the NSArray to an NSString I get the same exact result. Comparing them to themselves will be equal. How can I determine why one and two aren’t equal? thank you.

- (void)confused:(NSArray *)two {

    NSArray *one = [NSArray arrayWithObjects:@"16777223", @"7", nil];
    NSArray *two = [[NSBundle bundleWithPath:@"/path/to/bundle"] executableArchitectures];

    // NSArray "two" shows as 16277223, 7 in NSLog

    if ([two firstObjectCommonWithArray:(NSArray *)one])
    {
        NSLog(@"- it's equal %@ %@", one, two);
        // if array one matches array two then this will output
    }
    else {
        NSLog(@"- it's NOT equal %@ %@", one, two);
    }

    return;
}

Here’s the output from console:

myApp (
    16777223,
    7
)
myApp (
    16777223,
    7
)
myApp - it's NOT equal (
    16777223,
    7
)(
    16777223,
    7
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:49:52+00:00Added an answer on June 7, 2026 at 5:49 am

    -[NSBundle executableArchitectures] returns an array of NSNumber objects, not NSString objects, so the array you’re passing in doesn’t have strings in it. If you change

    NSArray *one = [NSArray arrayWithObjects:@"16777223",@"7", nil];
    

    to

    NSArray *one = [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInteger:NSBundleExecutableArchitectureX86_64], 
                                             [NSNumber numberWithUnsignedInteger:NSBundleExecutableArchitectureI386], 
                      nil];
    

    your code should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two buttons that are not performing the IBAction that they are programmed
Possible duplicate : comparing-two-arrays I have two NSArray and I'd like to create a
I have two columns say Main and Sub . (they can be of same
I have a dependent UIPicker that loads the values into its two components from
I have an NSArray that contains two types of objects. Lets call them Apple
I have two NSArray s each containing NSString s. I need to test whether
I have two NSArray variables, each one of then gets a similar NSDictionary inside.
I have two blocks that are being dispatched concurrently on a user-defined concurrent queue,
I have a two column NSTableView that I want to populate with entries grabbed
I have two arrays, one that is made up of NSDates and one that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.