Why is object not dealloc'ed when using ARC + NSZombieEnabled

前端 未结 5 1095
借酒劲吻你
借酒劲吻你 2020-11-30 01:25

I converted my app to ARC and noticed that an object alloc\'ed in one of my view controllers was not being dealloc\'ed when that view controller was dealloc\'ed. It took a w

5条回答
  •  渐次进展
    2020-11-30 01:50

    to answer the second question you would need to remove the observer from NSNotification - that will keep it from calling the view.

    Normally, you would do this in the dealloc but with that zombie issue maybe it's not getting called. Maybe you could put that logic in viewDidUnload?

提交回复
热议问题