Do I need use dealloc method with ARC?

后端 未结 5 1707
别跟我提以往
别跟我提以往 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:46

    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.

提交回复
热议问题