Re: CoreData retain/release/delete
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