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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:30:33+00:00 2026-06-16T20:30:33+00:00

I am parsing an XML file from a URL, from this XML I parse

  • 0

I am parsing an XML file from a URL, from this XML I parse titles of events, their dates, and locations of the events among other things. These elements are cached in an array called stories which acts as my data source for my table view. My goal is to display and indexed UITableView with the sections based on the date at which my events take place by month (January’s events in a section, February’s events in another, with month names as the titles for my sections). The events that will take place soonest will be at the top of my view, events further out should be at the bottom of my list, I don’t have to worry about events that have already taken place. So far I’ve been able to display my event names and their dates as subtitles in my UITableView not sorted or indexed, left in the order by which they were parsed. When I log the stories array I view this in the console:

2013-01-04 00:17:22.332 NumberTwo[72213:c07] the stories array is as follows: (
    {
    additionalDesc = "";
    allday = "Yes.";
    endtime = "11:55 PM";
    isodate = "2013-05-23";
    location = "";
    starttime = "12:00 AM";
    title = "CST Exam Makeups";
},
    {
    additionalDesc = "";
    allday = "No.";
    endtime = "12:00 PM";
    isodate = "2013-06-01";
    location = "";
    starttime = "8:00 AM";
    title = "SAT & Subject Tests";
},)

There is an example of two elements in the array, I understand I am going to have break down the stories array into smaller ones based on the month that the events occur but I don’t know what that method would look like. Here’s my attempt at it in the viewDidLoad.

- (void)viewDidLoad {
[super viewDidLoad];

self.sections = [NSMutableDictionary dictionary];
for (UIEvent *event in stories)
{

    NSDate *dateRepresentingThisDay = tempDate;

    // If we don't yet have an array to hold the events for this day, create one
    NSMutableArray *eventsOnThisDay = [self.sections objectForKey:dateRepresentingThisDay];
    if (eventsOnThisDay == nil) {
        eventsOnThisDay = [NSMutableArray array];

    }

    // Add the event to the list for this day
    [eventsOnThisDay addObject:event];
}

// Create a sorted list of days
NSArray *unsortedDays = [self.sections allKeys];
self.sortedDays = [unsortedDays sortedArrayUsingSelector:@selector(compare:)];

}

I know the line for (UIEvent *event in stories) must be incorrect but I’m sure what should replace it. tempDate is a formatted date I receive from an NSDateFormatter in another method, and event is meant to refer to an element in my array stories. If you could, point me in the right direction to accomplish my goal, it would be much appreciated. Thank You.

  • 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-16T20:30:34+00:00Added an answer on June 16, 2026 at 8:30 pm

    For this you have to use the following steps:
    1. On the number of section method of table view write the array count.
    2. you also have to modify your array by comparing the dates which are available on stack overflow and arrange in array according to your requirement.
    3. Set title by giving title.text = [your array object at index[index path of section]]
    4. Now you can give rows as you like in it.

    This are just steps you need to follow..
    Have you got what I mean to say?

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

Sidebar

Related Questions

I am using feedparser for parsing from XML file.But I couldn't parse <geo:lat> ,
I got a string from parsing a XML file which looks like this: Fri,
I am parsing xml file from url(in code below), using file_get_contents() function, and simpleXML,
I'm parsing XML from URL. What changes has been made to parse same XML
Hii it's easy for me to parse a XML file from a web URL
When i retrieve the XML file from URL, i can Parse all the elements
I want to parse xml file from url : http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=cher&api_key=5d6ce941674603e4bb75cfad6cfa13b7 I want to parse
I am Parsing an XML file from a URL using an NSXMLParser , the
I have this NSXMLParser that parsing an XML file from a webserver parser =
I am parsing xml file from server using xmlParser in Android. When i print

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.