presentModalViewController在iOS6的(presentModalViewC

2019-08-16 19:23发布

在我的应用程序的代码,我仍然presentModalViewController呈现viewcontrollers模态。 这在iOS的6弃用这是否意味着这种方法对运行iOS 6的设备有没有影响?

如果是的话,我怎样才能让我的应用程序目前viewcontrollers模态在iOS 6? 我的Xcode版本不支持iOS 6的,所以在iOS 6中所有新方法都无法给我。

Answer 1:

已过时意味着你不应该再使用此方法。 它仍然有效,但它可能在未来的更新之一被完全去除。

对于模态显示视图控制器,你可以使用新的-presentViewController:animated:completion:在iOS版5.0中引入的方法。
对于驳回新方法-dismissViewControllerAnimated:completion:

https://developer.apple.com/documentation/uikit/uiviewcontroller



Answer 2:

如果你有

[self presentModalViewController:aController animated:YES];

将其更改为

[self presentViewController:aController animated:YES completion:nil];


文章来源: presentModalViewController in iOS6