在ios 6中首先弃用dismissmodalviewcontrolleranimated [英] dismissmodalviewcontrolleranimated is deprecated first deprecated in ios 6
本文介绍了在ios 6中首先弃用dismissmodalviewcontrolleranimated的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚更新了iOS 6,并运行了我在iOS 4.3中创建的旧代码。他们在我的申请中给了我一些警告。
I have just updated iOS 6, and run my old code, which is created in iOS 4.3. They give me number of warnings in my application.
我用 presentModelViewController:
然后我解雇了它,但它给了我警告
I used presentModelViewController:
and then I dismiss it, but it gave me warning
在iOS 6中不推荐使用dismissModalViewControllerAnimated。
dismissModalViewControllerAnimated is deprecated first deprecated in iOS 6.
为什么他们会对该代码发出警告?以下是代码:
Why they show warning to that code? Here is the code:
[picker dismissModalViewControllerAnimated:YES];
此行变为黄色并显示错误。请给我指导以删除警告。
This line gets yellow and show the error. Please give me guideline to remove the warning.
推荐答案
现在在ios 6中你可以使用
Now in ios 6 You can use
[[Picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
而不是
[[Picker parentViewControl] dismissModalViewControllerAnimated:YES];
和
[self presentViewController:picker animated:YES completion:nil];
而不是
[self presentModalViewController:picker animated:YES];
这篇关于在ios 6中首先弃用dismissmodalviewcontrolleranimated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文