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

  • Home
  • SEARCH
  • 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 9173093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:30:32+00:00 2026-06-17T16:30:32+00:00

I have two core data entities named Assignment and Question. Assignment entity has assignment

  • 0

I have two core data entities named Assignment and Question. Assignment entity has assignment details like its name, id etc. Question table has question name, id etc. Assignment has one to many relationship with Question. When I try to fetch the assignments details from server, I get assignment and question data and both Assignment and Question entities are updated in the core data store. Note that two different assignments might share same questions.

Now lets consider, assignment 1 has questions with id 1,2 and 3. Where as assignment 2 has questions with id 4, 5 and 1. In my question table it has only 5 entries as the question with id 1 is common in both the assignments.

I am using a NSFetchedResultsController to poulate this on the UI. I have an issue with fetching the questions in the same order it is added to the core data store(database)

For example: For assignment 2, I need questions in oder 4,5 and 1. There is no unique key using which I can create the sort descriptor.Without sort descriptor I can not create NSFetchRequest and without that it is not possible to create NSFetchedResultsController. Any thoughts on solving this issue?

  • 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-17T16:30:33+00:00Added an answer on June 17, 2026 at 4:30 pm

    To my mind, the best pattern would be to create a new entity, AssignmentQuestion, that has a has many-to-one relationship to Assignment and a many-to-one relationship to Question, as well as a sequence number attribute.

    Assignment <--------->> AssignmentQuestion <<--------> Question
    |--name                 |--sequence                   |--text
    |--id                                                 |--id
    |--etc.                                               |--etc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

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
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
I have two Core Data entities: Parent and Child . Parent has to-many relationship
I have two core data entities, Articles and Favorite . Articles has To-Many relationship
I have two entities in a Core Data Model like these: A <<--->> B
I'm using core data in my app. I have two entities that are related:
I have two entities in core data with one to many relationship between them
I'm currently facing in problem using Core Data. I have two entities A and

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.