Re: CoreData - calculations in tables?
Re: CoreData - calculations in tables?
- Subject: Re: CoreData - calculations in tables?
- From: Charilaos Skiadas <email@hidden>
- Date: Wed, 6 Jul 2005 15:14:26 -0500
On Jul 6, 2005, at 2:53 PM, Alan Dail wrote:
ok, I've done some more testing.
the first approach was to add an itemCount method that returns the
current count as suggested in the link. The problem here is, the
display doesn't update immediately when I add/remove items to the
list in the other table. Checking continuously update doesn't seem
to help, and this doesn't seem to be what I'd want to do anyway.
What I want is to simply have the view be notified that there was a
change so it can recompute on an as needed basis.
Did you also add the necessary code in your initiallize method to
trigger the notifications on changes? Something like:
+ (void)initialize {
if (self == [CHSGradesItem class]) {
NSArray *keys = [NSArray arrayWithObject:@"grades"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey:@"totalGrades"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey:@"totalStudents"];
}
}
Sorry I didn't mention this earlier, I thought it was in the link I
mentioned, but I guess it was somewhere else that I saw it. I think
some ADC document, can't remember where.
The basic idea is to get notified when there's a change to a
sublist so the calculation, display (and sorting if appropriate)
will get updated.
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