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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:21:55+00:00 2026-05-14T19:21:55+00:00

I am using coredata framework. In my NSManagedObjectModel i am using three entities that

  • 0

I am using coredata framework. In my NSManagedObjectModel i am using three entities that are Class, Student and Score where class and student have one-to-many & inverse relationship and Student and Score have also inverse but one-one relationship.

Score entity has all optional attributes and having default ‘0’ decimalVaue, which is not assigned at the time new Student is added. But later i want to assign them score individually and also to particular attribute not all of score attributes in a go. I am able to create and add Students to particular Class but dont have any idea how to call particular student and assign them score. For example
I want to assign Score‘attribute “dribbling” [there are many attributes like “tackling”] a decimal value to Student “David” of Class “Soccer” ,how i can do that?

Thanks in advance for any suggestion.

  • 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-05-14T19:21:56+00:00Added an answer on May 14, 2026 at 7:21 pm

    I have found a solution. First time when creating or adding a new student to class (NSManaged)object in class (NSManaged)Context, also add a new instance of Score (NSManaged)object having newly created or added student in its relationship and at the same time assign them default ‘0’ value to all other attributes.
    Later you can reassign values depending upon situation.

    [student setValue:@"Beckham" forKey:@"lastName"];
    [student setValue:@"Soccer" forKey:@"belongsToClass"]; 
    

    after this new student has been added keep a reference to it and use it in new Score object as-

    Score *score = [NSEntityDescription insertNewObjectForEntityForName:@"Score" inManagedObjectContext:managedObjectContext];
    score setValue:[NSNumber numberWithInteger:0] forKey:@"dribbling"];//attribute
    [associatedScore setValue:[self newlyAddedStudent] forKey:@"belogsToStudent"];//relation
    

    Thats it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CoreData, I have an entity Bookmark, that has an to-many relationship named 'tags'
I have an application in XCode using the sqlite/coredata database and that has already
I have developed a application that using core data framework to store the data.
In my app, Im using CoreData and I have two entities. VenueInfo and ContactInfo.
I have a sample app using CoreData, and am now ready to convert my
This had been driving me crazy.... I have an iPhone app that is using
Still am using Coredata framework for iPhone applications. I want switch to use SQLite
I have a cocoa-touch app, using the core data framework. I've created a xcdatamodel
I have made a new split view iPad app using CoreData. All I have
I'm working with an app using CoreData. I have a simple structure: Name Lastname

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.