We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
以下源代码不够严谨: [viewController willMoveToParentViewController:nil]; [viewController.view removeFromSuperview]; [viewController removeFromParentViewController]; 如果需要重新setViewControllers时,会移除之前的控制器,如果之前的控制器view没有加载,移除时会先走viewDidLoad, 然后才移除,若viewDidLoad里面同步任务较多,造成卡顿等问题。
可改为: [viewController willMoveToParentViewController:nil]; if (viewController.isViewLoaded) {//判断view是否已加载 [viewController.view removeFromSuperview]; } [viewController removeFromParentViewController];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
以下源代码不够严谨:
[viewController willMoveToParentViewController:nil];
[viewController.view removeFromSuperview];
[viewController removeFromParentViewController];
如果需要重新setViewControllers时,会移除之前的控制器,如果之前的控制器view没有加载,移除时会先走viewDidLoad, 然后才移除,若viewDidLoad里面同步任务较多,造成卡顿等问题。
可改为:
[viewController willMoveToParentViewController:nil];
if (viewController.isViewLoaded) {//判断view是否已加载
[viewController.view removeFromSuperview];
}
[viewController removeFromParentViewController];
The text was updated successfully, but these errors were encountered: