Editing an attribute of an NSManagedObject fires fault for to-many relationships of that object?
Editing an attribute of an NSManagedObject fires fault for to-many relationships of that object?
- Subject: Editing an attribute of an NSManagedObject fires fault for to-many relationships of that object?
- From: "Barry Wark" <email@hidden>
- Date: Sat, 22 Sep 2007 17:20:07 -0700
In my CoreData application, I've noticed an unexpected number of
fetches from an SQL store. I traced these fetches to setting an
attribute of an object from that store. The attribute in question is a
Boolean attribute, but chaning its values fires the fault for the
to-many relationships of that object as well. Since these fetches
sometimes take seconds, this behavior adds unacceptable delay to the
user interface when the user just wants to change the value of a
checkbox.
A demo project that exhibits the behavior in question can be
downloaded at http://rieke-server.physiol.washington.edu/~barry/CoreDataFaultLab.zip.
In this app, the Managed Object Model contains an Entity Foo which has
two attributes and two to-many relationships to Entities Bar and Baz.
The UI is the IB-generated UI for managing many Foo objects. The
executable has com.apple.CoreData.SQLDebug set to 2. If you run the
project's app, add a Foo to the document and save, then reopen, you
will notice that the run log shows a fetch for the bar and baz to-many
relationships of Foo if you edit either of the attributes of the saved
Foo instance.
Why are these faults fired when the user edits a simple property of
the Foo object? Is this a known bug? Is there a way to prevent these
faults from firing?
Any suggestions or advice greatly appreciated!
thanks,
Barry
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden