will the retained/strong class member variables got automatically clean'd up on unloading a view controller?

后端 未结 4 839
无人共我
无人共我 2021-01-25 17:00

I have the following property

.h

@property (nonatomic, strong) NSMutableDictionary *cache;

.m

@synthesize cache = _cach         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-25 17:33

    You can add:

    -(void)dealloc { 
        // If you are using ARC remove the line below
        [super dealloc]
    } 
    

    And put a breakpoint and it will tell you when it is being released. The dealloc method will be called with ARC as well, just be sure that you don't call [super dealloc] in ARC.

提交回复
热议问题