Cocoa bindings performance
Cocoa bindings performance
- Subject: Cocoa bindings performance
- From: Niels Meersschaert <email@hidden>
- Date: Fri, 7 Apr 2006 14:26:05 -0400
I've come across a strange behavior & I'm trying to determine if it
is a bug or something wrong with my implementation. I have a core
data document based app. I'm using the standard NSArrayContoller
bound to an entity in Interface Builder. I have several properties in
my UI that depend on looking at the array controller's
arrangedObjects & the model key path is @sum.fieldname.
After saving a document that had about 3000 entities, I close it.
When I reopen the document, the GUI shows the spinning beachball for
several minutes. I've put in logging to determine the array
controller is getting valueForKey for each entity to generate the
sum. That's fine & expected, but it takes forever. Here's the rub:
In the readFromURL method in my document class, I did the same
effective lookup that the array controller is. I got the entity from
the context, fetching all objects & then got the sum of the field
looping thru all of the entities in the returned array. When I do
this, the file loads immediately & the bindings show the correct data
for each @sum field. Why the dramatic difference in performance? Is
this a bug in NSArrayController or do I need to do the manual lookup
in my document class?
Thanks,
Niels
_______________________________________________
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