UIViewController *red = [[UIViewController alloc]init];
red.view.backgroundColor = [UIColor redColor];
//当前控制器 presentViewController 一个子控制器
[self presentViewController:red animated:YES completion:nil];
[UIApplication sharedApplication].keyWindow.rootViewController = [[ViewController alloc]init];
[[UIApplication sharedApplication].keyWindow sendSubviewToBack:[UIApplication sharedApplication].keyWindow.rootViewController.view];
//在 ViewController 加载完毕后。red.view也在window中。为什么没有伴随上一个控制器一起被销毁呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
学习是最好的投资!