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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:37:39+00:00 2026-05-30T17:37:39+00:00

I want to sort the Dictionary value following is my dictionary response that have

  • 0

I want to sort the Dictionary value following is my dictionary response that have four key value pair like- “artist_id”, “artworks_count”,”first_name”,”last_name”. I want to sort it according to “first_name” how to do. please help me.

2012-03-02 16:10:41.299 Paddle8[4928:207] The currentArtistNameDict is-- >{
    "artist_id" = 370;
    "artworks_count" = 1;
    "first_name" = Gerri;
    "last_name" = Davis;
}
2012-03-02 16:10:41.300 Paddle8[4928:207] The currentArtistNameDict is-- >{
    "artist_id" = 369;
    "artworks_count" = 1;
    "first_name" = Stephen;
    "last_name" = Cimini;
}

2012-03-02 16:10:41.302 Paddle8[4928:207] The currentArtistNameDict is-- >{
    "artist_id" = 367;
    "artworks_count" = 1;
    "first_name" = Melinda;
    "last_name" = Buie;
}

2012-03-02 16:10:41.305 Paddle8[4928:207] The currentArtistNameDict is-- >{
    "artist_id" = 358;
    "artworks_count" = 7;
    "first_name" = Kcho;
    "last_name" = "<null>";
}

Any help is highly Appreciated..

  • 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-05-30T17:37:41+00:00Added an answer on May 30, 2026 at 5:37 pm

    NSDictionary objects are by definition unsorted, so you’d be best off iterating through your dictionary and putting the items into an NSMutableArray, and then using the sortUsingDescriptors method to sort the array.

    Here’s an example that might help:

    scores = [NSMutableArray arrayWithArray:[defaults
    objectForKey:@"HighScores"]];
    [scores addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"Andrew", @"Name", [NSNumber           numberWithUnsignedInt:45], @"Score", nil]];
    [scores addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"Andrew2", @"Name",     [NSNumber numberWithUnsignedInt:55], @"Score", nil]];
    [scores sortUsingDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc]    initWithKey:@"Score" ascending:NO] autorelease]]];
    

    (taken from http://www.iphonedevsdk.com/forum/iphone-sdk-development/6146-sort-array-dictionary-objects.html)

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

Sidebar

Related Questions

I have a Dictionary<> which I want to sort based on value so I've
I have a dictionary where I want to alphabetically sort the keys that have
i want to sort dictionary based upon value of each dictioanry item.but if i
I have a dictionary: a = {'100':12,'6':5,'88':3,'test':34, '67':7,'1':64 } I want to sort this
I want to sort the items that have been previously selected with checkboxes. If
I have a dictionary of dictionaries like the following d = { 'hain': {'facet':
So I have a List of Dictionary<string, string> dict and I want to sort
I have a Dictionary and I want to sort it by Person, could anyone
I often have to sort a dictionary (consisting of keys & values) by value.
I have a dictionary that I want to show in a form. What's the

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.