问题
//通过如下跳转,通过xcode 的debug view hierarchy的工具发现UITransitionView没有移除掉导致当前的控制器没有释放掉
UIStoryboard *storyboard =
[UIStoryboard storyboardWithName:kStoryboardName_Main
bundle:nil];
UIViewController *mainBoard =
[storyboard instantiateViewControllerWithIdentifier:
kStoryboardID_MainTabBarController];
[UIApplication sharedApplication].delegate.window.rootViewController = mainBoard;
[[UIApplication sharedApplication].delegate.window makeKeyAndVisible];
解决办法
//通过xcode工具检测到UITransitionView没释放导致当前控制器无法释放 为此要先移除该视图,之后再把导航栏pop掉,最后再切换根视图
for (UIView *subview in [UIApplication sharedApplication].delegate.window.subviews) {
if ([subview isKindOfClass:NSClassFromString(@"UITransitionView")]) {
[subview removeFromSuperview];
}
}