search

Home  >  Q&A  >  body text

objective-c - iOS VC push 和 popRootVC VC释放问题

有三个控制器,aVC push到bVC, bVC再push到cVC, 然后cVC popToRootViewController, 只有cVC会走dealloc方法, bVC不会走...

如果我cVC popTo bVC, bVC popTo aVC, 这样c b控制器都走dealloc方法,怎样让popToRootVC 之后,bVC也销毁掉?

大家讲道理大家讲道理2772 days ago661

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 09:17:07

    You need to check whether there is still a reference to bVC somewhere, such as in block or aVC.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 09:17:07

    The memory leak in the ARC environment should be caused by a circular reference. Check it. If it is not obvious, look at NSTimer. It may also cause a circular reference

    reply
    0
  • Cancelreply