I have created a core data model that has two entities which have a one to many relationship. The entities are Exams and Questions. An Exam can have many questions.
What is the best way to save the Questions entities so they would be associated with the specific Exam?
The flow I want it to have is to start a new exam with an exam name, then add questions, then close out the exam with the questions count and save it to the persistent store.
After creating a
Questionobject, just set its.examproperty (provided that’s the name of the inverse relationship to e.g.Exam.questions) to the containing exam object. If you need to order the questions, have a look at ordered relationships (available since Lion / iOS 5) or this or this.