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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:51:24+00:00 2026-06-14T09:51:24+00:00

I have an NSSet that contains many different types of objects. Typically it will

  • 0

I have an NSSet that contains many different types of objects. Typically it will contain some combination of NSDictionaries, NSStrings, NSArrays, and Classes, i.e. the objective-c “Class” type. I need a way to produce an NSArray containing all of the objects in this NSSet, but is sorted so that it will always be in the same order for any set containing the same objects. To be specific, by “same object” I mean by value, not by address. It doesn’t matter how it’s sorted, as long as it’s consistent.

I haven’t found a way to do this so far. I can’t find any way of doing an ordered comparison between two arbitrary objects. Does anyone have any suggestions on how to accomplish this?

  • 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-14T09:51:26+00:00Added an answer on June 14, 2026 at 9:51 am

    All objects are derived from NSObject, so you could simply sort by [NSObject description] (reference) which will be a summary of the object contents.

    EDIT: As pointed out by @Paul.s in the comment; hash (reference) is the way to go (it will be quicker to compare).

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

Sidebar

Related Questions

I have a Core Data object that contains an NSSet of other objects (e.g.
I have a NSSet containing many thousands of NSValue objects (wrapping CGPoints ). I
I have some code that looks like this in my GLKViewController subclass: -(void)touchesBegan:(NSSet *)touches
I have a Core Data store which contains a number of MediaItem entities that
I have a UIScrollView which contains any number of thumbnails that should detect the
I have the following task: I'm given an NSSet of objects each of which
I have an NSArray which contains Person objects. This person object contains the following;
I have an NSManagedObject that has a to-many relationship to another NSManagedObject. During creation
I have a mutable array of managed objects that I get from Core Data
Suppose I have a UIViewController subclass that takes care of some UIViews. These UIViews

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.