• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using NSFetchedResultsController with many-to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSFetchedResultsController with many-to-many relationship


  • Subject: Using NSFetchedResultsController with many-to-many relationship
  • From: Glen Huang <email@hidden>
  • Date: Sat, 10 Mar 2018 16:47:05 +0800

Hi,

I have two models: Person and Club. They have a many-to-many relationship. I
want to display all people in a table view sectioned by clubs (which means
there might be duplicate people across sections). I wonder how to do that with
NSFetchedResultsController? NSFetchRequest never returns the same object more
than once.

One solution I can come up with is to use multiple NSFetchedResultsController,
one for each section(club). But in my case people are editable, so I’d like to
also track changes. Listen to multiple NSFetchedResultsController seems pretty
cumbersome if not impossible (especially with regard to the adding or removing
of clubs, either because everyone leaves a club or a person joins a new club).

I wonder if there is a direct way to achieve that or a better way to
approximate?

Best
Glen
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using NSFetchedResultsController with many-to-many relationship
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Re: Put UICollectionView within UITableViewCell
  • Next by Date: Re: Using NSFetchedResultsController with many-to-many relationship
  • Previous by thread: Re: Put UICollectionView within UITableViewCell
  • Next by thread: Re: Using NSFetchedResultsController with many-to-many relationship
  • Index(es):
    • Date
    • Thread