• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData retain/release/delete
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData retain/release/delete


  • Subject: Re: CoreData retain/release/delete
  • From: John Brownlow <email@hidden>
  • Date: Fri, 29 Apr 2005 15:49:31 -0400

That almost answers my question.

But I am concerned about managedObjects whose retain count falls to zero, but which are *not* explicitly deleted using -deleteObject.

Are these automatically deleted from the persistent store on save, or do they hang around?

I create a lot of objects with many relationships which I do not want to track manually. Once they are released from all relationships and their retain count falls to zero, I want them to be deleted from the persistent store since I have no further use for them.

An example of this might be a 'sequence' object, which is an ordered collection of 'scene' objects. Once a sequence has lost all of its scenes and has been removed from any parent sequences, its retain-count will be zero and I would like it to be removed from the persistent store on the next save, since I may create and dispose of hundreds of these objects in the course of writing a screenplay over many weeks.

I don't want to have to track this manually, so I'm trying to find out how exactly it works.



On Apr 29, 2005, at 3:07 PM, Scott Stevenson wrote:

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.
--
John Brownlow
Deep Fried Films, Inc

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

_______________________________________________
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


  • Follow-Ups:
    • Re: CoreData retain/release/delete
      • From: Scott Stevenson <email@hidden>
References: 
 >CoreData retain/release/delete (From: John Brownlow <email@hidden>)
 >Re: CoreData retain/release/delete (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Re: Spotlight Plugins don't immediately work?
  • Next by Date: Re: CoreData retain/release/delete
  • Previous by thread: Re: CoreData retain/release/delete
  • Next by thread: Re: CoreData retain/release/delete
  • Index(es):
    • Date
    • Thread