有一段时间后会有自动解除警报视图的方法吗? [英] Is there a way to dismiss an alertview automatically after some time?
本文介绍了有一段时间后会有自动解除警报视图的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种方法,在一段时间后或任务完成后自动关闭警报视图。
有可能吗? (或者用一段时间来显示消息的方式?)
I'm looking for a way, to automatically dismiss an alert view after some time or after a task is done. Is there a possibility? (or another way to show a message for some time?)
推荐答案
你可以调用 -dismissWithClickedButtonIndex:animated:
方法以关闭警报视图。
You can call the -dismissWithClickedButtonIndex:animated:
method to dismiss the alert view.
要自动关闭它,请创建一个NSInvocation,然后使用 -performSelector:withObject:afterDelay:
to -invoke
it。
To dismiss it automatically, create an NSInvocation and then use -performSelector:withObject:afterDelay:
to -invoke
it.
这篇关于有一段时间后会有自动解除警报视图的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文