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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:46:48+00:00 2026-06-01T08:46:48+00:00

I have an NSMutableArray of NSArray’s inside it. This is my current structure: Paused

  • 0

I have an NSMutableArray of NSArray’s inside it. This is my current structure:

    Paused index (
       (
          0,
          3579
       ),
       (
          1,
          3538
       )
    )

how to search through the array and remove the object 3538? My expected result is:

    Paused index (
       (
          0,
          3579
       )
    )

How can I get the index of the outer array? I can already do the search but how can I remove the object in that index?

  • 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-01T08:46:50+00:00Added an answer on June 1, 2026 at 8:46 am

    This is a very straight forward way.

        NSArray *firstArray =  [NSArray arrayWithObjects:[NSNumber numberWithInt:100],[NSNumber numberWithInt:1000], nil];
    NSArray *secondArray =  [NSArray arrayWithObjects:[NSNumber numberWithInt:100],[NSNumber numberWithInt:5000], nil];
    
    NSMutableArray *arrayWithArray = [NSMutableArray arrayWithObjects:firstArray,secondArray,nil];
    int i = 0;
    
    for (NSArray *innerArray in arrayWithArray) 
    {
        if ([innerArray containsObject:[NSNumber numberWithInt:5000]])
        {
            break;
        }
        i++;
    
    }
    NSLog(@"Index of object %d",i);
    [arrayWithArray removeObjectAtIndex:i];
    

    Some other intelligent way should be there.

    EDIT:
    I think this is little better.

    int i = [arrayWithArray indexOfObjectPassingTest:^BOOL(id element,NSUInteger idx,BOOL *stop)
        {
           return [(NSArray *)element containsObject:[NSNumber numberWithInt:5000]];
        }];
    
        NSLog(@"Index of object %d",i);
        if (i >= 0 && i < [arrayWithArray count]) 
        {
             [arrayWithArray removeObjectAtIndex:i];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NSMutableArray *Number=[NSArray arrayWithObjects: @1, @2, @3, @4, @5, @6, nil]; I have an array
I have a NSMutableArray and a NSArray . Both consist of elements that are
I have a NSMutableArray that I need to search for a string and return
I have an NSMutableArray. It's members eventually become members of an array instance in
I have an NSMutableArray that contains many NSArrays. At a specific (static) index in
I have a NSMutableArray named as records and a NSArray . Now I am
-(NSArray*)getSomeStuff { NSMutableArray *array = [[NSMutableArray alloc]init]; // Add some objects to array return
I have an NSMutableArray called *favorites . It is an array of NSStrings and
I have two arrays, an NSMutableArray and an NSArray. The NSMutableArray is the store,
I have my function getAllData, which is returning an array with dictionaries. - (NSArray

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.