I have a model ‘Pens’ and it has such properties: “makerName” and “Count”. How can I get sum of all ‘Count’ ? Can Core Data count that for me ? Thanks…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
There are two ways to solve this problem:
first – get your data to NSSet or NSArray and use @sum operator:
second is using specific fetch for specific value with added NSExpressionDescription with a sum. This way is harder but better for larger db’s