Dealloc method in iOS and setting objects to nil

后端 未结 4 1139
礼貌的吻别
礼貌的吻别 2020-12-13 05:22

I have a pretty basic question. In some examples I\'ve seen, objects are just released in the dealloc method. In others, the objects are released and then set to nil

4条回答
  •  感动是毒
    2020-12-13 05:39

    - (void)dealloc
    {
         [searchPlace release];
         [super dealloc];
    }
    - (void)viewDidUnload
    {
         [super viewDidUnload];
         self.searchPlace = nil;
    }
    

    Is this like what you say?

提交回复
热议问题