Skip navigation.
 
mlCoreData retain/release/delete
FROM : John Brownlow
DATE : Fri Apr 29 20:53:44 2005

I am a long way into a rather complicated CoreData based app right now
and I have managed to figure out most of it, including some bodges to
handle ordered lists, but one thing is still not totally clear to me.

Let's say on a previous save you have written out a managedObject to
the persistent store.

You re-launch the app, and the managedObject is fetched as part of your
document.

You edit your document, and delete whatever it is that requires the
managedObject. The managed object is released and its retain count
falls to 0.

What happens now? I know that the managedObjectContext will retain
certain objects with pending changes, so is that what happens here? Is
it actually only de-allocated when the MOC saves the next time?

More importantly, what happens to the copy in the persistent store?
When the MOC saves, is the persistent store overwritten, and the object
effectively deleted from the saved file, or does it hang around and
have to be deleted manually using the -deleteObject method?

--
John Brownlow
Deep Fried Films, Inc

http://www.johnbrownlow.com
http://www.pinkheadedbug.com

Related mailsAuthorDate
mlCoreData retain/release/delete John Brownlow Apr 29, 20:53
mlRe: CoreData retain/release/delete Scott Stevenson Apr 29, 21:07
mlRe: CoreData retain/release/delete John Brownlow Apr 29, 21:49
mlRe: CoreData retain/release/delete Scott Stevenson Apr 29, 22:03
mlRe: CoreData retain/release/delete John Brownlow Apr 29, 22:22
mlRe: CoreData retain/release/delete Scott Stevenson Apr 29, 22:29
mlRe: CoreData retain/release/delete Bill Bumgarner Apr 29, 23:46
mlRe: CoreData retain/release/delete Johnny Deadman Apr 30, 02:02
mlRe: CoreData retain/release/delete Scott Stevenson Apr 30, 02:09
mlRe: CoreData retain/release/delete mmalcolm crawford Apr 30, 02:10
mlRe: CoreData retain/release/delete Johnny Deadman Apr 30, 02:16
mlRe: CoreData retain/release/delete Shawn Erickson Apr 30, 02:21
mlRe: CoreData retain/release/delete mmalcolm crawford Apr 30, 02:23
mlRe: CoreData retain/release/delete Shawn Erickson Apr 30, 02:32