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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:10:42+00:00 2026-05-27T06:10:42+00:00

Using CoreData, I have an entity Bookmark, that has an to-many relationship named ‘tags’

  • 0

Using CoreData, I have an entity “Bookmark”, that has an to-many relationship named ‘tags’ to another entity “Tag”, and some commun attributes (string, date, …).

In a NSTableView we display the Bookmarks entity via Binding:

  • the NSArrayController is binded to File’s Owner.managedObjectContext
    (standard XCode CoreData template, the managedObjectContext is in the AppDelegate)
  • The columns in TableView are binded to their respective attribute. In particular the Tag column is binded to this arrayController.arrangedObjects.tags with a subclass of NSValueTransformer so that we can show, as an NSString, a summary of the to-many relationship.

It work. Now when I click on column header the whole table view get sorted correctly except for the ‘tag’ column where I get this:

-[_NSFaultingMutableSet compare:]: unrecognized selector sent to instance

For sure the “Set” from this to-many relationship doesn’t respond to the selector ‘compare:’.

Question:
How can I make this work ? How can I sort on a to-many relationship ?

Are something like the ValueTransformer available ? If I could supply a custom class that would do the compare: for the ArrayController to know…

  • 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-27T06:10:42+00:00Added an answer on May 27, 2026 at 6:10 am

    One possible hack: since _NSFaultingMutableSet is a NSSet, we can add the selector ‘compare:’ via a categorie.

    @interface NSSet (someAdditions)
       - (NSComparisonResult)compare:(NSSet *)anotherSet;
    @end
    
    @implementation NSSet (someAdditions)
       - (NSComparisonResult)compare:(NSSet *)aSet {
          ...  
       }
    @end
    

    we can now implement this compare: selector as we wish, like comparing the count of each set, or their NSString representation in some way.

    It work in my App. I re-enabled the ‘Creates Sort Descriptor’ on the binding of the NSTableColumn and can now click on the header of my tableView to sort.

    It’s a hack because it affect all NSSet… But at least I have my hook.

    What do you think ?

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

Sidebar

Related Questions

I have an application in XCode using the sqlite/coredata database and that has already
I have a UITableView that fetches data from CoreData using FetchedResultsController and it registers
I have 2 entities, A and B that have a many to many relationship.
I am using CoreData and have an Entity ContactList defined, which I created using
I have an iPhone app that is using CoreData. I recently made some minor
I have a Core Data Model consisting of a Trail that has-many Locations. I
I have a sample app using CoreData, and am now ready to convert my
I'm using core data in my app. I have two entities that are related:
I am using CoreData but I don't think I got the inverse relationship concept
I am using coredata framework. In my NSManagedObjectModel i am using three entities that

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.