iOS : ARC, not freeing memory

前端 未结 3 1857
夕颜
夕颜 2021-01-24 13:47

I\'ve kind of a weird issue with my iOS app. after a while my app goes low in memory so memory warning, everything seems to be fine, but when I check the memory usage I noticed

3条回答
  •  礼貌的吻别
    2021-01-24 14:22

    So I managed to work with my issue.

    I wrote "-(void) dealloc" methode in all my controllers and check if I enter in it as I should. (on pop controller, dissmiss etc..)

    Every time it didn't, I do step by step in the controller to see what was retaining my controller from beeing dealloc.

    most of the time it was some property that was not in "unsafe_unretained" delegate that was in "ASSIGN" (and should not be in assign but in unsafe_unretained) (heritage from non-ARC project...)

    I also had some strange controller with XIB that was not deallocated even if empty. I rebuild new one step by step with copy/paste and finaly with exactly the same code, the new controller was released, with no visible difference between then !!! gnneee

    at least I know how to debug that kind issues now...

提交回复
热议问题