我正在从控制器层次结构中删除 viewController removeFromParentViewController
,但deinit
视图控制器没有被调用。我怎样才能检查什么对它有很强的参考价值?
有什么方法可以查看内存中存在的参考图吗?
这就是我的 swap` 方法的样子:
public class func swap(fromViewController: UIViewController!, toViewController: UIViewController!, containerViewController: UIViewController!) {
fromViewController.willMoveToParentViewController(nil)
containerViewController.addChildViewController(toViewController)
toViewController.view.frame = containerViewController.view.bounds
containerViewController.transitionFromViewController(fromViewController, toViewController: toViewController, duration: 0.2, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: {}, completion: {finished in
fromViewController.removeFromParentViewController()
toViewController.didMoveToParentViewController(containerViewController)
})
}
我transitionFromViewController
completion
应该添加/删除目标/源视图吗?
有什么方法可以在 Swift中访问refCount
a吗?viewController
我试图用Instruments
. 弄清楚什么对视图控制器有很强的引用,但无法弄清楚。有什么帮助吗?