UIViewController retain count problem

前端 未结 4 1250
我寻月下人不归
我寻月下人不归 2021-01-25 16:11

I am creating a new UIViewController with the below code

GameViewController *temp = [[GameViewController alloc] initWithNibName:@\"GameViewController\" bundle:ni         


        
4条回答
  •  被撕碎了的回忆
    2021-01-25 16:48

    I advise you never using retainCount because it usually gives false information about the actual retaincount of your object!!!!

    Just follow the appropiate memory management practices!!!! It's very simple really, just follow the NARC principle, release only the objects that have these words: New Alloc Retain Copy. NARC! :)

    I strongly advise you using the memory leaks tool from instruments that tells you which objects were not released and which objects where released and you are trying to access.

提交回复
热议问题