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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:36:53+00:00 2026-05-20T22:36:53+00:00

If that was a little confusing here’s a visual representation: Array > Object >

  • 0

If that was a little confusing here’s a visual representation:

Array > Object > Dictionary > Values

Here’s some context if this helps:

An array contain playlists. Each playlist has a dictionary. Each dictionary contains metadata.

I need to sort the original dictionary by this metadata.

I’ve been pretty stumped at implementing this. Thoughts?

[Edit] Changed the higher dictionary into an array

  • 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-20T22:36:53+00:00Added an answer on May 20, 2026 at 10:36 pm

    You want to use at least one NSSortDescriptor. This is basically an abstract way of representing a way to sort something. It can contain a key path (more on that in a second) or a function pointer, or some other way to compare two objects.

    You’ll probably want to use it with a key path. So if you have an array of Foo objects, and they have a “dictionary” property that returns an NSDictionary, and you want to sort the array based on a value in the dictionary under the key @"bar", then the sort descriptor you’d create would be:

    [NSSortDescriptor sortDescriptorWithKey:@"dictionary.bar" ascending:YES]
    

    From here you can use -[NSArray sortedArrayUsingDescriptors] and pass it an array containing this NSSortDescriptor.

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

Sidebar

Related Questions

This is a little confusing to explain, so bear with me here... I want
OK, that question sounds maybe a little confusing so I'll try to explain it
I have a little snippet that formats a date for a timestamp like this:
Here's a little snippet that I'm trying execute: >>> from datetime import * >>>
I saw some code yesterday in this question that I had not seen before,
This might be a little confusing. I'm creating this slider thing. When a slide
It's a little confusing that ZCML registrations for Zope utilities can accept a component
Here is my little problem that makes me feel stupid. I'm testing my rails
The subject is a little confusing, but here is what I'm trying to do:
Because the data size isn't little that my web app needs to load, it

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.