
double delayInSeconds = 2.0; dispatch_time_t popTime = dispatch_time(disPATCH_TIME_Now,delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime,dispatch_get_main_queue(),^(voID){ // code to be executed on main thread.If you want to run in another thread,create other queue }); 总结 以上是内存溢出为你收集整理的iphone – 执行方法延迟后不使用NSThread或sleep() – 还有另一个选项?全部内容,希望文章能够帮你解决iphone – 执行方法延迟后不使用NSThread或sleep() – 还有另一个选项?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)