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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:33:35+00:00 2026-06-14T04:33:35+00:00

Possible Duplicate: Sorting NSString values as if NSInteger using NSSortDescriptor I have an Array

  • 0

Possible Duplicate:
Sorting NSString values as if NSInteger using NSSortDescriptor

I have an Array that I fill with my NSMutableDictionary.. and I use this:

myArray =[[myDict allKeys]sortedArrayUsingSelector:@selector(IDONTKNOW:)];

AllKeys of myDicts are NSStrings… like 123.423 or 423.343… I need to sort the new myArray by incremental numbers.. 12.234 45.3343 522.533 5432.66 etc etc

What must insert in @selector to do this properly? 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-14T04:33:36+00:00Added an answer on June 14, 2026 at 4:33 am

    You can use an NSSortDescriptor and pass doubleValue as the key.

    //sfloats would be your [myDict allKeys]
    NSArray *sfloats = @[ @"192.5235", @"235.4362", @"3.235", @"500.235", @"219.72" ];
    NSArray *myArray = [sfloats sortedArrayUsingDescriptors:
                        @[[NSSortDescriptor sortDescriptorWithKey:@"doubleValue" 
                                                        ascending:YES]]];
    
    NSLog(@"Sorted: %@", myArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Ruby: Sorting 2 arrays using values from one of them I have
Possible Duplicate: Sorting an associative array in PHP I have an array that looks
Possible Duplicate: problem sorting using member function as comparator Is it possible to use
Possible Duplicate: sorting in nsmutable array I have 2 NSMutableArray array. I have to
Possible Duplicate: Sorting a multidimensional array? I have an a multi dimesional associative array:
Possible Duplicate: PHP: sorting a multidimentional array ($arr[$i]['v']) I have an array of UNSORTED
Possible Duplicate: Sorting an associative array in PHP Hello all, I have an array
Possible Duplicate: PHP custom sorting I have an array, Array ( [Flag] => 2
Possible Duplicate: Sorting an IList in C# I have an IList<Keyword> where Keyword is
Possible Duplicate: Sorting objects in an array by a field value in JavaScript var

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.