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

后端 未结 4 813
无人共我
无人共我 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:34

    Can not answer for ARC, but viewdidUnload does not mean the VC is released. It means the view is being released. To force it, you can try having a NavigationController, push a couple of views, and in Simulator send some Memory Warnings. viewDidUnload will be called for the vcs that are not the top one.

    Re: ARC, you can surely have a dealloc method, that will be called when the vc is released. Simply don't call super.

提交回复
热议问题