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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:59:49+00:00 2026-06-07T14:59:49+00:00

I need to sort rows by due dates from XML: <plist version=1.0> <array> <array>

  • 0

I need to sort rows by due dates from XML:

<plist version="1.0">
<array>
<array>
    <string>23 Jan 2012</string>
    <string>Chinese New Year</string>
    <string>Closed</string>
</array>
<array>
    <string>24 Jan 2012</string>
    <string>Chinese New Year</string>
    <string>Closed</string>
</array>
</array>

I have studied the answer given in : Objects Sorting With date ,Time Problem in Array(Iphone Development) which i found very useful but i’m in doubt:

  1. I don’t understand where do i get the @”entity” and @”date” . Is it a variable or id and where do i obtain it?

    if (date)
    {
    [dict setObject:entry forKey:@”entity”];
    [dict setObject:date forKey:@”date”];
    [tempArray addObject:dict];
    }

  2. The month given is in a MMM format (JAN,FEB,MAR), which is fixed as one of my project scope and i clueless about how am I able to sort by the abbreviation as compared to the normal numbered ones.

Would deeply appreciate some help here as I’m so stuck with this for a few days!! Thanks!

  • 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-07T14:59:51+00:00Added an answer on June 7, 2026 at 2:59 pm

    make a class(YourClass) with objects (yourDateString, yourEvent, yourStatus)

    YourClass
    --yourDateString
    --yourEvent
    --yourStatus
    

    parse your xml save details in object of this class (YourClass) and store the objects in this array(arrayWithYourContents) using

        NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setTimeStyle:NSDateFormatterFullStyle];
        [dateFormatter setDateFormat:@"dd mmm yyyy"];
    
        arrayWithYourContents sortUsingComparator: ^(id dateObj1, id dateObj2) 
         {
             NSDate *date1 = [dateFormatter dateFromString:[(YourClass *) dateObj1 yourDateString]];
    
    
             NSDate *date2 = [dateFormatter dateFromString:[(YourClass *) dateObj2 yourDateString]];
    
             return [date2 compare: date1];
         }
         ];  
    

    I am not sure about the date format (@”dd mmm yyyy”).. please check if this works or change it to which matches to yours.

    arrayWithYourContents shall now contain your sorted date components.

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

Sidebar

Related Questions

I have an array of rows from a database I need to sort by
I need to sort list of strings in the alphabetical order: List<String> list =
I need to sort nodes in xml. I have the following code which successfully
I need to sort string, and I came up with the following function. def
I need to sort an array that can look like this: $array[4][0] = array('id'
I need to sort an array of months (alphabetical months) according to their months
I need to sort a collection of objects by a utf-8 string property (built
I'd like MySQL to use the index to sort these rows. SELECT identity_ID FROM
I need to sort through an array and sort each individual row in array
I need to sort a html string so I get the content I need.

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.