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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:51:50+00:00 2026-05-31T00:51:50+00:00

hi all how is the code for get the total response in the array

  • 0

hi all how is the code for get the total response in the array actually i have implemented code as shown in the below here my problem is when i calling the method in in next class i am getting array response null so plz help me to avoid this problem in iphone.

My code is:

-(void)countrySelection{

    NSString *jobSearchUrlString = [NSString stringWithFormat:@"http://infra2appsmobile.cloudapp.net/Infra2Apps.svc/Countries"];
    //NSLog(@"url for new articles is = %@",jobSearchUrlString);
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:jobSearchUrlString]];   

    NSURLConnection *theconnection =  [[NSURLConnection alloc] initWithRequest:request delegate:self];
    if (theconnection) {
        RoutData = [[NSMutableData alloc] init];
    }

}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{   

    [RoutData setLength: 0];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    [RoutData appendData:data];

           NSString *thexml = [[NSString alloc] initWithData:RoutData encoding:NSUTF8StringEncoding];

    NSDictionary *dictXML= [XMLReader dictionaryForXMLString:thexml error:nil];

    NSMutableArray *arrStation = [[dictXML objectForKey:@"feed"] objectForKey:@"entry"] ;//this would return the array of station dictionaries

    for (int i=0; i<[arrStation count]; i++) {
        NSLog(@"---->> String Type Country names <<---: %@",[[[[[arrStation objectAtIndex:i] objectForKey:@"content"] objectForKey:@"m:properties"] objectForKey:@"d:CountryName"] objectForKey:@"text"]);
        [materialarray addObject:[[[[[arrStation objectAtIndex:i] objectForKey:@"content"] objectForKey:@"m:properties"] objectForKey:@"d:CountryName"] objectForKey:@"text"]];

        NSLog(@"--->>** Array Type Country names **<<<---%@",materialarray);


    }



}

My response is:

2012-03-09 12:49:40.856 TableSample[4862:f803] —->> String Type Country names <<—:
France
2012-03-09 12:49:40.867 TableSample[4862:f803] —>>** Array Type Country names <<<—(null)
2012-03-09 12:49:40.868 TableSample[4862:f803] —->> String Type Country names <<—:
MEA HQ
2012-03-09 12:49:40.869 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:40.870 TableSample[4862:f803] —->> String Type Country names <<—:
Israel
2012-03-09 12:49:40.871 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:40.872 TableSample[4862:f803] —->> String Type Country names <<—:
Turkey
2012-03-09 12:49:40.879 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:40.879 TableSample[4862:f803] —->> String Type Country names <<—:
UAE
2012-03-09 12:49:40.880 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:40.881 TableSample[4862:f803] —->> String Type Country names <<—:
SA
2012-03-09 12:49:40.881 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:40.882 TableSample[4862:f803] —->> String Type Country names <<—:
RSA
2012-03-09 12:49:41.020 TableSample[4862:f803] —>>
Array Type Country names <<<—(null)
2012-03-09 12:49:41.021 TableSample[4862:f803] —->> String Type Country names <<—:
WE HQ
2012-03-09 12:49:41.022 TableSample[4862:f803] —>>
Array Type Country names **<<<—(null

  • 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-05-31T00:51:51+00:00Added an answer on May 31, 2026 at 12:51 am

    In connectionDidFinishLoading delegate method you will get the response string, you need to call JSONValue on that response string it will give you the results in an array.

    - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
        [connection release];
        NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
        NSLog(@"responseString %@",responseString);
        self.responseData = nil;
        NSArray *responseArray = [responseString JSONValue];
        [responseString release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using the following PHP code: // Get all subordinates $subords = array();
I'm using the following code to get an array with all sub directories from
i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
I have got some code to load an assembly and get all types, which
Background: I'm trying to get a total line count of all of the code
How could I write code to get all the action names from a controller
Directory.GetFiles(targetDirectory); Using the above code we get the names( i.e full path) of all
I am trying to get the code to list all the directories in a
I've been trying to get this code to work for hours! All I need
I've got some code that will generically get all Controls in a form and

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.