automatic ref counting - Objective-C destructor with ARC -


i'm trying create cleanup code in objective-c class, overwriting dealloc:

-(void)dealloc {     //cleanup code     [super dealloc]; } 

though cannot since [super dealloc] disallowed compiler when arc enabled. there alternative can use?

from transitioning arc release notes (emphasis mine):

you may implement dealloc method if need manage resources other releasing instance variables. not have (indeed cannot) release instance variables, may need invoke [systemclassinstance setdelegate:nil] on system classes , other code isn’t compiled using arc.

custom dealloc methods in arc do not require call [super dealloc] (it results in compiler error). chaining super automated , enforced compiler.

so can same sort of cleanup in dealloc when using arc, don't call super.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -