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

  • Home
  • SEARCH
  • 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 8287655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:06:37+00:00 2026-06-08T12:06:37+00:00

I have a XML file in the documents directory that I am trying to

  • 0

I have a XML file in the documents directory that I am trying to parse (to display in a table view).

<tickets>
  <ticket>
    <tid>11111</tid>
    <status>Open</status>
    <summary>Summary 1</summary>  //want to grab this
    <notes>Notes 1</notes>
  </ticket>
  <ticket>
    <tid>11112</tid>
    <status>Open</status>
    <summary>Summary 2</summary>  //want to grab this
    <notes>Notes 2</notes>
  </ticket>

  ...

</tickets>

I would like summary to be displayed in the table view. For now, I am just trying to get a NSMutableArray filled with all of the summary strings.

I am using XMLReader to create a dictionary of everything. I then use the following code to try to get to summary.

NSData *data = [NSData dataWithContentsOfFile:save];
NSString *xml = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

// Parse the XML into a dictionary
NSError *parseError;
NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLString:xml error:&parseError];

NSDictionary *ticketsArray = [xmlDictionary objectForKey:@"tickets"];
NSDictionary *ticketArray = [ticketsArray objectForKey:@"ticket"];;
//Now have a dictionary with ticket... what to do next?

I’m not sure where to go next. Do you have any idea how to get all of the summaries into a NSMutableArray? I can use something other than XMLReader if that is preferred.

  • 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-08T12:06:38+00:00Added an answer on June 8, 2026 at 12:06 pm

    Try this:

    for (NSDictionary *d in ticketArray) {
        NSDictionary *d2 = [d objectForKey:@"summary"];
        [summaries addObject:[d2 objectForKey:@"text"]];
    }
    

    The strings that you get back for your summary text may need to be trimmed, but the basic idea should work.

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

Sidebar

Related Questions

I have an XML document as follows: <directory> <file><monitored>0</monitored> <xferStatus>1</xferStatus> <name>test1.txt</name> <size>7</size> <created>03/31/10 11:30:02
I have an XML file and parse it into my PHP document. I want
I have a C# class method that return a xml document not file. How
I have an XML file from which I am parsing some content to display
I have an XML file that looks like <?xml version=1.0> <playlist> <name>My Playlist</name> <song>
I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have a class that parses XML documents into an array. I have 2
I have a python script that parsing an xml file and is returning the
Let's say I have to read from a directory that has many large XML
I am trying to open a directory that contains a series of XML's in

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.