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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:37:21+00:00 2026-06-10T14:37:21+00:00

I want to sort my array…. In my array elements are in this order

  • 0

I want to sort my array….
In my array elements are in this order dateArray{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}

But i want this array in reverse order
I used this code for reversing..

dateArray=[[NSMutableArray alloc]initWithArray:[[date reverseObjectEnumerator] allObjects]];

But it gives this output

dateArray=(
9,
8,
7,
6,
5,
4,
3,
2,
19,
18,
17,
16,
15,
14,
13,
12,
11,
10,
1,
0
)

But i want this output dateArray(19,18,17,16,15,14,13,12,11,10……..2,1,0)
I also used sorting method but output is same. how can i do this??? Please help

EDITED:

My array elements are the contents of NSDocument Directory….

SOLVED
this question has been sovled. I don’t know the exact way to sort my array as i want but i changed my subpaths name. and it gives right output..

Thanks in Advance

  • 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-10T14:37:22+00:00Added an answer on June 10, 2026 at 2:37 pm

    if you are want to work with strings instead of numbers, you should use the following format for the correct sorting:

    20, 19, … 10, 09, 08, … 02, 01, 00

    therefore, you just have to add a leading 0 to every number. if they are strings, you can sort them like strings only, not like numbers, this is why the leading zero is needed.


    by the way the most painless solution is to rename the subpaths then, where the strings come, and you won’t need to change anything else in your application for getting the right order.

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

Sidebar

Related Questions

I want to sort my array: p1q1 p1q10 p1q2 to this order: p1q1 p1q2
I want to sort an array that looks like this (to numerical order instead
I want to sort an array by 'hits', but I also want to look
Hello i do want a sort an array, that contains this: String[] info =
I have NSMutableArray* names , which contains NSStrings. I want to sort the array
I want to sort the array c. But I don't get the answer a,b,c,d.
I want to sort an array by using uasort() function. I wrote this piece
$array = array(2011-September_38,2011-June_4,2010-November_9,2011-November_29,2010-December_19); i want to sort this array strings as following, it should
I've a big problem. I want to sort an array like this: '0' ...
I want to sort an array of strings that contain names and numbers. But

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.