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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:32:27+00:00 2026-06-03T09:32:27+00:00

I have core data model with two entities that have a many-to-many relationship with

  • 0

I have core data model with two entities that have a many-to-many relationship with each other.

Eg,

Conference <<---->> Speaker

A conference can have many speakers, and One speaker can be at many conferences.

Im trying to use NSFetchedResultsController the main entity for fetchRequest is the Speaker.

While it does list all speakers alright, but Im trying to get the section as the “Conference” name and list all speakers within that section. I want it so that the name “John” as speaker would appear in two sections. Which implies that he’s a speaker at two conferences.

This is the sectionNameKeyPath i’m using: @"conferences.Name"

NSFetchedResultsController *aFetchedResultsController = [[[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"conferences.Name"  cacheName:@"fCache"] autorelease];

It kinda doesn’t work, i get {TedEx} as the section title when i use [sectionInfo name].

The other problem is that If I One speaker appears in one section, (conference), it wont appear in the other section (even if that section(conference) has that speaker object).

This is potentially because, I get the sectionName as a set of combined Conferences. TedEx, SXSW as a single section.

Some how the goal should be to single out the sectionNameKeypath to fetch only ONE Conference and list all speakers within each. Perhaps i should set some kind of a predicate?

Im kinda in a bind here, is the approach a problem? I’ve read about Predicates but its kinda hard to grasp if your new to core data.

  • 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-03T09:32:28+00:00Added an answer on June 3, 2026 at 9:32 am

    This is a little different from the way you are thinking of doing it, and I’m not sure if there is a better way to accomplish it with a FRC & sectionNameKeyPath like you want to or not, but perhaps this will work:

    1. Instead of fetching Speakers, just do a normal NSFetchRequest to get
      an NSArray called conferences. You could have this sorted by
      conferenceName or date or whatever you need.
    2. Then for your table view set the number of sections to the [conferences count].
    3. For number of rows in each section get the Conference object for that section [conferences objectAtIndex:section], and return the speakers count of that Conference.
    4. To populate the cell data, just get the Speaker object by called: [[conferences objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a core data model that has two entities which have a
I have a core data model that has two entities, Bid and Result. I
In my Core Data model I have two entities: List and Patient. List has
I have the following core data model with two entities: entity item which holds
In my project, I have two Core Data entities. One is the grouping (can
I have a Core Data model with two entities: A and B. A has
I have a relationship in a Core Data model that feels like it wants
I have two entities in a Core Data Model like these: A <<--->> B
I have set up a Core Data model where I have two objects, say
I have an application that uses Core Data. I have two data models in

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.