如何将方法调用延迟 1 秒? [英] How can I delay a method call for 1 second?

查看:14
本文介绍了如何将方法调用延迟 1 秒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有简单的方法将方法调用延迟 1 秒?

Is there an easy way delay a method call for 1 second?

我有一个对触摸事件作出反应的 UIImageView.当检测到触摸时,应用程序中会出现一些动画.一秒钟后,我想调用另一个方法.在这种情况下,我不能使用 animationDidStop 选择器.

I have a UIImageView that reacts on a touch event. When the touch is detected, some animations happen in the app. After one second, I want to call another method. In this case, I can't use the animationDidStop selector.

推荐答案

performSelector:withObject:afterDelay:

文档参考

这篇关于如何将方法调用延迟 1 秒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆