Do I need use dealloc method with ARC? Do I need use dealloc method with ARC? ios ios

Do I need use dealloc method with ARC?


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.


No.

You don't need dealloc method in ARC.

But if you want to do some cleanup tasks when your view is dismissing or released. It's the best place, In such case you can implement it.

For example:

You are running a timer in your view and it's updating your view. When you are dismissed the view you need to stop that timer. In that condition you can use dealloc method and stop timer there.

Similar for NSNotification observer.


If you are using ARC.

No need to use dealloc and release, compiler knows that your property and objects are strong / weak so it will manage it.

EDIT:

dealloc method is required if you use coreframework objects like CG... & CF.... Even you create observers for notifications you need to remove it and dealloc is the best place to removeObserver.