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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:11:26+00:00 2026-05-25T14:11:26+00:00

I am currently connecting to a database that then gets a bunch of xml

  • 0

I am currently connecting to a database that then gets a bunch of xml that I parse with NSXMLParser (as shown below) Once this is done I would like to pass the array data to another method to sort it and then seperate the array into sections (this is so my uitableview Index will work). And finally displayed in my tableview.

My Main question is how (where in the code) can I pass my data array over to the method I have created.

#pragma mark - Parsing lifecycle

- (void)startTheParsingProcess:(NSData *)parserData
{
    [myDataArray release]; // clears array for next time it is used.
    myDataArray = [[NSMutableArray alloc] init]; //initalizes the array, this is a must have!!!! :)

    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:parserData]; //incoming parserDatapassed to NSXMLParser delegate which starts parsing process 

    [parser setDelegate:self];
    [parser parse]; //Starts the event-driven parsing operation.
    [parser release];

    //[self.tableView reloadData]; // this reloads the data in the tabel view once the nsmutablearray has been filled with values
}

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
    if ([elementName isEqual:@"item"]) {
        // NSLog(@"Found title!");
        itemString = [[NSMutableString alloc] init];
    }
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    [itemString appendString:string];
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
    if ([elementName isEqual:@"item"]) {
        //NSLog(@"ended title: %@", itemString);
        [myDataArray addObject:itemString]; //this is where i pass the values over to my array.

        //TODO: Test release on memory consumption etc
        [itemString release];
        itemString = nil;
    }
}

//method to sort array and split for use with uitableview Index
- (IBAction)startSortingTheArray:(NSMutableArray *)arrayData
{

}
  • 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-25T14:11:28+00:00Added an answer on May 25, 2026 at 2:11 pm

    Implement didEndDocument delegate method for your NSXMLParser,
    if your – (IBAction)startSortingTheArray:(NSMutableArray *)arrayData return type is non IBAction, lets say its return type is void the following should work fine. I don’t know what happens when you pass arrayData to IBAction return type method.

    - (void)parserDidEndDocument:(NSXMLParser *)parser
    {
       [self startSortingTheArray:myDataArray];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a database that gets updated from a legacy application. I'd like
I'm currently converting our company database application from VB to ASP.NET. This is pretty
I am currently working on a Windows Service that does a database call and
I currently have an MS Access application that connects to a PostgreSQL database via
Currently I have Windows App which is directly opening database connection (SQL Server is
I currently run Visual Studio 2008 SP1 connecting to Team Foundation Server. I want
Currently working with converting SQLException error messages into messages that are more useful for
TL DR; Want some Java help with connecting to a truly local database (
Currently, I'm sitting on an ugly business application written in Access that takes a
I've designed a C# game that makes use of an Access .mdb database file

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.