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 8181509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:32:55+00:00 2026-06-07T00:32:55+00:00

So basically I have a huge array of arrays (only a 2-d array)… My

  • 0

So basically I have a huge array of arrays (only a 2-d array)…

My root array lets say has 100 child arrays…

I want to query the root/child arrays and return only the child arrays that have its 2 object equal to hello…

So basically I have a made-up idea below…

updatedArray = [rootArray WHERE childArray objectAtIndex:2 == @"hello"];

Now as you can see I want updated array to contain like 40 or 50 of the child arrays in the rootArray…

See what I mean – its kind of like MySQL only with an array instead of a database?

  • 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-07T00:32:57+00:00Added an answer on June 7, 2026 at 12:32 am

    Try this:

    NSMutableArray *updated = [[NSMutableArray alloc] init];
    for (NSArray *a in rootArray)
    {
        if ([[a objectAtIndex:2] isEqualToString:@"hello"])
            [updated addObject:a];
    }
    

    Now updated will contain the arrays in rootArray whose 3rd object is @"hello".

    Don’t forget to release it after use (if you don’t use ARC).

    You can also use predicates for simple logic; see the NSPredicate class.

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

Sidebar

Related Questions

what I mean by that is: I basically have a class that has too
My demo is here . Basically, I have a HUGE image (19160px × 512px
So I have this huge tree that is basically a big switch/case with string
I have a huge array that is written literally thanks to a script. It
Say you have a huge (> 1GB) CSV of record ids: 655453 4930285 493029
Basically have many huge delimited files that I know I can import as a
I have a huge table in a database and I want to split that
I wonder if anyone else has asked a similar question. Basically, I have a
I basically have three tables, posts, images and postimages (this simply contains the ids
I basically have a unix process running and it is doing some heavy processing

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.