FROM : Scott Stevenson
DATE : Fri Apr 29 21:07:32 2005
On Apr 29, 2005, at 11:53 AM, John Brownlow wrote:
> 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?
I believe the object hangs around until you save, but it should return
YES to -isDeleted in the meantime.
> More importantly, what happens to the copy in the persistent store?
Unchanged until you save.
> 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?
You only have to delete it once, then save. Does that answer the
question?
A Managed Object could also be deleted indirectly if it's at the
destination end of a relationship which is set to "cascade", and the
owner of the relationship is deleted.
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]
DATE : Fri Apr 29 21:07:32 2005
On Apr 29, 2005, at 11:53 AM, John Brownlow wrote:
> 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?
I believe the object hangs around until you save, but it should return
YES to -isDeleted in the meantime.
> More importantly, what happens to the copy in the persistent store?
Unchanged until you save.
> 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?
You only have to delete it once, then save. Does that answer the
question?
A Managed Object could also be deleted indirectly if it's at the
destination end of a relationship which is set to "cascade", and the
owner of the relationship is deleted.
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]
| Related mails | Author | Date |
|---|---|---|
| John Brownlow | Apr 29, 20:53 | |
| Scott Stevenson | Apr 29, 21:07 | |
| John Brownlow | Apr 29, 21:49 | |
| Scott Stevenson | Apr 29, 22:03 | |
| John Brownlow | Apr 29, 22:22 | |
| Scott Stevenson | Apr 29, 22:29 | |
| Bill Bumgarner | Apr 29, 23:46 | |
| Johnny Deadman | Apr 30, 02:02 | |
| Scott Stevenson | Apr 30, 02:09 | |
| mmalcolm crawford | Apr 30, 02:10 | |
| Johnny Deadman | Apr 30, 02:16 | |
| Shawn Erickson | Apr 30, 02:21 | |
| mmalcolm crawford | Apr 30, 02:23 | |
| Shawn Erickson | Apr 30, 02:32 |






Cocoa mail archive

