Do I need use dealloc method with ARC?

Vit picture Vit · Jan 24, 2013 · Viewed 18.8k times · Source

So, I have class:

@interface Controller : NSObject
{
    UILabel* fileDescription;
}

@property(strong, nonatomic) UILabel* fileDescription;

Do I need use method dealloc where property fileDescription will equal nil?
For example:

-(void)dealloc
{
    fileDescription = nil;
}

If not, who will dismiss memory used by fileDescription?

Answer

trojanfoe picture trojanfoe · Jan 24, 2013

Generally you don't need to provide a subclassed dealloc method as ARC manages the lifetime of the instance variables.

However it can be useful to perform clean-up other than releasing objects, for example to remove an observer or close a network connection down cleanly. You are therefore allowed to subclass dealloc under ARC, but you are not allowed to call [super dealloc] from within the subclassed method.

In your particular case it's not required, however.