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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:41:22+00:00 2026-06-18T04:41:22+00:00

This is my simplified NSMutableArray from a JSON parsing: { main { array0, array1,

  • 0

This is my simplified NSMutableArray from a JSON parsing:

{
main 
{ 
  array0, 
  array1,
  array2,
  array3,    <----- remove!
  array4,    <----- remove!
  array5,
  array6,    <----- remove!
  array7,    <----- remove!
  array8,
  ...,
}
}

Im looking the best way to REMOVE SINGLE array items ALTERNATIVELY, example only arrays 2,4,6,8; Also, if I need to remove COUPLES of array 3,4 and 6,7, always alternatively?

EDIT: this is the first solution, to remove SINGLE items alternatively:

for (int i=0; i < [array count]; i = i+1) {
[array removeObjectAtIndex:i];
}
  • 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-18T04:41:24+00:00Added an answer on June 18, 2026 at 4:41 am

    To me it sounds like you could easily create an index set of all the indexes to remove and remove the objects at those indexes using removeObjectsAtIndexes:.

    You can get the indexes of all the even (or odd) indexed objects from indexesOfObjectsPassingTest:.

    NSMutableArray *array = // Your array where objects should be removed from
    NSIndexSet *indexesToRemove = [array indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
        return idx%2==0; // index is even (even objects get removed)
    }];
    [array removeObjectsAtIndexes:indexesToRemove];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jQuery plugin from the jQuery build of TinyMCE. This simplified
Here is the simplified JSON file, I need to download it from a net
I am serializing the cl_long2 type from OpenCL which is defined like this (simplified
I'm trying to convert (and understand) this simplified piece of code from unityscript to
I'm using this (simplified) chunk of code to extract a set of tables from
Having this (simplified) XML: <?xml version=1.0 encoding=UTF-8?> <kml> <Document> <Placemark> <name>Poly 1</name> <Polygon> <coordinates>
Given this simplified snippet : <html> <body> <div> <div style='text-align:center;'>asdfaskjdfakjsd</div> <div style='float:right'> <input type='submit'
Imagine this simplified markup: <div id=header> <!-- Other things.... --> <div id=detail> </div> </div>
I have code like this (simplified): def outer(): ctr = 0 def inner(): ctr
I have this (simplified) class: public class StarBuildParams { public int BaseNo { get;

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.