• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData - calculations in tables?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData - calculations in tables?


  • Subject: Re: CoreData - calculations in tables?
  • From: Charilaos Skiadas <email@hidden>
  • Date: Wed, 6 Jul 2005 01:28:23 -0500


On Jul 6, 2005, at 12:40 AM, Alan Dail wrote:

I am building an app with CoreData and have run into a couple of issues.

I have a view with two tables, each with their own NSArrayController. Using bindings, the content set of the 2nd controller is the selection of the first controller. i.e. the first table is a list of people, the 2nd list is a list of items for the selected person. When I select a person, I can add or delete items for that person. What I wanted to do, though, is add a column to my table that has the number of items for each person. The first thing I tried was to simply copy the way the # out of # display is generated when you create a defeault core data view - i.e. I mapped a table column to items.@count - this actually displays the item count for each person, but does not update when items are added or removed and caused all sorts of problems if i added items to the main list as a result of notifications.

What sorts of problems? I usually find useful answers to such problems by googling for the exception that was thrown in the console.
As a possible solution, maybe you could set the "Continuously updated value" checkbox at the right place?


How should I be doing things like this. In addition to a simple total, I'd also like to be able to do other calculations on items in the list. For instance, if they have an attribute that is a number, I'd like to be able to have the main list give a total amount from summing all of the items in the sublist.

I think this came up in the past, I had a very similar problem yesterday. I think this might answer your question, it did in my case:
http://www.cocoabuilder.com/archive/message/2005/5/18/136314
Alan



Haris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: CoreData - calculations in tables?
      • From: Alan Dail <email@hidden>
References: 
 >CoreData - calculations in tables? (From: Alan Dail <email@hidden>)

  • Prev by Date: CoreData - inspector view?
  • Next by Date: pdfkit
  • Previous by thread: CoreData - calculations in tables?
  • Next by thread: Re: CoreData - calculations in tables?
  • Index(es):
    • Date
    • Thread