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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:03:21+00:00 2026-06-04T15:03:21+00:00

I am getting below response into the nsarray when I used the JSON parsing

  • 0

I am getting below response into the nsarray when I used the JSON parsing from my required URL but here I don’t like to get 2,1,4,4,6,5,8,7,10,9,12 and 11 in single array I have to get total response into two arrays I mean one array set will consists 2,4,6,8,10 and other array set must be 3,5,7,9 and 11.

So how is the code for separation of single array response into two arrays in iPhone?

"(\n    2,\n    1\n)",
"(\n    4,\n    3\n)",
"(\n    6,\n    5\n)",
"(\n    8,\n    7\n)",
"(\n    10,\n    9\n)",
"(\n    12,\n    11\n)"
  • 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-04T15:03:23+00:00Added an answer on June 4, 2026 at 3:03 pm

    If you combine every number into one large array, you could feasibly test if each number is even or odd with a simple if-else in a for-in loop. Maybe like this:

    -(NSArray*)parseJSONIntoArrays:(NSArray*)array {
        NSMutableArray *evenNumbers = [[NSMutableArray alloc]init];
        NSMutableArray *oddNumbers = [[NSMutableArray alloc]init];
    
        for (NSNumber *number in array) {
            if (([number intValue] %2) == 0) {
                //even
                [evenNumbers addObject:number];
            }
            else {
                //odd
                [oddNumbers addObject:number];
            }
        }
        return [[NSArray alloc]initWithObjects:evenNumbers, oddNumbers, nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting json data as a response back from the server. I want
i am trying to get only JSON response from a webservice. i am getting
getting dataset as like below Webservices *details=[[Webservices alloc] init]; [details getMobileNumberDetails:phnotextfield.text]; NSLog(@longitudes Arrays from
I'm currently getting the AccessControlException below when I deploy to app engine (I don't
I am getting a web service response as below. It has additional XML tag
I am getting image from an url. I am using imageview in listview. I
I have added the library ksoap2-android-assembly-2.4-jar-with-dependencies.jar but i am getting below error : Exception
Am getting Soap response using as Soap Object and retrieving properties. see this below
I'm getting this parsing error below. I cannot get this to work. What is
I want to use jQuery function to fetch web service response but getting error

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.