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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:17:49+00:00 2026-05-24T20:17:49+00:00

– (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 1 && indexPath.row == 0)

  • 0
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 1 && indexPath.row == 0) {

    NSString *requestString = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/directions/xml?origin=%@&destination=%@,OK&sensor=false",startField.text,endField.text]; 

    NSURL *url = [[NSURL alloc] initWithString:requestString];
    NSData *tempData =[[NSData alloc] initWithContentsOfURL:url];

    NSString *Str  = [[NSString alloc] initWithData:tempData encoding:NSUTF8StringEncoding];



    NSLog(@"%@",Str);
    NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];


    //Initialize the delegate.
    xml1 *parser = [[xml1 alloc] init];

    //Set delegate
    [xmlParser setDelegate:parser];


    //Start parsing the XML file.
    BOOL success = [xmlParser parse];

    if(success){
        NSLog(@"No Errors");
        arySteps=[[NSMutableArray alloc]init];
        arySteps=[parser.ListofSteps1 mutableCopy];

    }
    else
        NSLog(@"Error Error Error!!!");

    controller.arayStep=[[NSMutableArray alloc]init];
    controller.arayStep=[parser.ListofSteps1 copy];
    controller= [[TableView alloc] initWithNibName:@"TableView" bundle:nil];


     [self.navigationController pushViewController:controller animated:YES];
     [controller release];
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

}

In above code i have parsed XML data. In XML-parser file i have store objects in array that is ListofSteps1. Now i access in root-view controller class which is shown in above code. So in root-view class ListofSteps1 assign value to array of root-view controller. Now i want to assign value of array of root-view controller to next view’s array which is also maintain in above code but array of next view is not getting value. What is problem in this code so it not getting value?

  • 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-24T20:17:51+00:00Added an answer on May 24, 2026 at 8:17 pm

    There are a couple of things wrong with your code above. You alloc and init a fresh array only to write over it on two separate occasions in your method implementation:

    arySteps=[[NSMutableArray alloc]init]; // This line serves absolutely no purpose
    arySteps=[parser.ListofSteps1 mutableCopy]; // This line is sufficient on its own
    

    Calling accessor methods on an null pointer will do you absolutely no good. You need to instantiate the object before you attempt to set its properties:

    controller= [[TableView alloc] initWithNibName:@"TableView" bundle:nil];
    controller.arayStep=[parser.ListofSteps1 copy];
    

    These mistakes are very basic and indicate that you need to work on the fundamentals before you can get too much further. I would suggest that you pick up a good book on Objective-C – for example, Programming in Objective-C by Stephen Kochan – and read it thoroughly. A solid understanding of the core concepts will serve you well going forward.

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

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I am getting the value from web service like &gt;&lt;&amp;&nbsp; etc. I want to
when i view my site : http://www.testtrack.tv/ in IE8's compatibility-mode the horizontal scrollpanes turn
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
So to start, I have an array of XML files. These files need to
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I'm trying to craft a Java regular expression to split strings of the general
The problem with unsigned char. I am reading a PPM image file which has
I am currently running into a problem where an element is coming back from

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.