• 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: Scott Stevenson <email@hidden>
  • Date: Fri, 29 Apr 2005 13:29:46 -0700


On Apr 29, 2005, at 1:22 PM, John Brownlow wrote:

Yeah, I've made pretty much everything in my app a custom subclass just so I can use proper accessors instead of the error prone -valueForKey.

Seems fine to me. :)


How about over-riding -dealloc like this, in appropriate subclasses?

- (void) dealloc
{
	// regular dealloc stuff

	[[self managedObjectContext] deleteObject: self];
}

It seems like it would work and is reasonably elegant, but it seems a bit too obvious to be valid code! :)

This won't work because your object could be dealloc'd for a number of different reasons. In fact, this would probably cause an infinite loop or crash of some sort. For that matter, I don't think you're supposed to override the stock -dealloc implementation.



- Scott

--
http://treehouseideas.com/
http://theocacao.com/ [blog]

_______________________________________________
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


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

  • Prev by Date: Re: CoreData retain/release/delete
  • Next by Date: Re: CoreData Best Practices
  • Previous by thread: Re: CoreData retain/release/delete
  • Next by thread: Re: CoreData retain/release/delete
  • Index(es):
    • Date
    • Thread