Do I need use dealloc method with ARC?

后端 未结 5 1706
别跟我提以往
别跟我提以往 2021-02-01 14:03

So, I have class:

@interface Controller : NSObject
{
    UILabel* fileDescription;
}

@property(strong, nonatomic) UILabel* fileDescription;

D

5条回答
  •  余生分开走
    2021-02-01 14:40

    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.

提交回复
热议问题