views:

24

answers:

0

I am trying to make a tableView that contains notes. The notes are tagged by the user. Each note might have several tags. I want to be able to sort the notes by tag into different sections. If a note has several tags I want the note to appear in all the different sections that the note is tagged for.

Right now I am using the NSFetchedResultsController to get the notes out of storage but I am getting an error when I try to set the sectionNameKeyPath to "tags.name". The error is:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid to many relationship in valuesToFetch (tags.name)'

This is because the tags are in a to many relationship with the notes.

Is there a way to do this with the NSResultsController, is there a way to do this at all?

Thank you for your time,

Light