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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:10:48+00:00 2026-05-27T02:10:48+00:00

I am new to xcode/ios etc… and having a little trouble figuring out a

  • 0

I am new to xcode/ios etc… and having a little trouble figuring out a problem. I cant seem to figure out how I would retrieve and perform calculations on attributes between entities in core data. Here is an example of what I am trying to do:

My project is a football app that has a one to many relationship. Season to Game (Season has a bunch of games. Season has attributes like teamname and datestart. Game has attributes like passing yards, running yards etc..

How would I be able to calculate something like total passing yards for the whole season (adding all the games passing yards together for that season)?

Thanks for your time.

  • 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-27T02:10:49+00:00Added an answer on May 27, 2026 at 2:10 am

    You managed object for Season has a relationship named hasGames (or whatever you named the relationship to the games). When you have a Season managed object, you can just access the hasGames relationship (it’s an NSSet), loop through all the games in there and do whatever you want with the data, e.g. adding some values up.

    EDIT:

    Example:

    If I take your Relationships Career -> Season -> Game, and suppose the relationships are called Career.hasSeasons and Season.hasGames, it would look something like this

    int passingYards = 0;
    
    Career* myCareer = [... fetchedresult for the career you are looking for ...];
    
    for(Season* season in myCareer.hasSeasons)
    {
      for(Game* game in season.hasGames)
      {
        careerPassingYards += [game.passingYards intValue];
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to XCode/iOS and I'm trying to figure out how to move a
I'm new to development using Xcode, and am having trouble using the built-in Leaks
I´m playing a little bit with the New iOS 5 SDK and Xcode 4.3.3
I am new to Mac, iOS, Xcode and objective-c. I am very familiar with
I am new to Xcode and iOS development. when I create a new project,
I updated to new Xcode 4.2 (for iOS 5), but now my project doesn't
Since I updated XCode for the new iOS 5.0 i get a warning in
I'm new to iOS development. I just installed Xcode 3.2.4 and the iOS 4.1
xcode 4.2 ios 5 single view template I am very new to this ios
With Lion and the new Xcode and ARC and Storyboard and the little glitches

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.