Re: Releasing Object belonging to Core Data transient attribute
Re: Releasing Object belonging to Core Data transient attribute
- Subject: Re: Releasing Object belonging to Core Data transient attribute
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 14 Mar 2006 00:17:53 -0800
On Mar 13, 2006, at 11:48 PM, Greg Herlihy wrote:
Setting the transient attribute value to nil for an object should
release
the value object (if there is one) which that attribute currently
holds:
[myCoreDataObject setValue:nil forKey:@"myTransientAttribute"];
Note that this operation effectively clears the value of the object's
attribute, so any subsequent valueForKey:@"myTransientAttribute"
message
sent to that object will return nil.
It's not clear what the context is here. You should probably not
arbitrarily set transient attributes to nil. Transient attributes
are tracked by Core Data and changes recorded for undo. If you
change a transient attribute, it dirties the managed object, the
context, and in an NSPersistentDocument-based application hence the
document. This may well lead to behaviour the user does not expect...
The appropriate way to reduce memory overhead is to turn managed
objects into faults, as described in <http://developer.apple.com/
documentation/Cocoa/Conceptual/CoreData/Articles/cdPerformance.html>.
mmalc
_______________________________________________
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