需要objective-c暂停/等待功能
发布时间:2020-12-16 09:28:47 所属栏目:百科 来源:网络整理
导读:我需要在我的iPhone objective-c应用程序中添加暂停/等待功能.函数sleep()对我不起作用. 需要在这两者之间添加暂停/等待功能. myscore += [self getcard];myscore += [self getcard]; 解决方法 我没有看到Objective-c的这样一个函数,但是我使用了一个NSTimer
我需要在我的iPhone
objective-c应用程序中添加暂停/等待功能.函数sleep()对我不起作用.
需要在这两者之间添加暂停/等待功能. myscore += [self getcard]; myscore += [self getcard]; 解决方法
我没有看到Objective-c的这样一个函数,但是我使用了一个NSTimer,它在你决定的时间间隔内调用给定的函数.
http://developer.apple.com/iphone/library/documentation/cocoa/reference/foundation/Classes/NSTimer_Class/Reference/NSTimer.html 更具体地说,使用函数scheduledTimerWithTimeInterval:target:selector:userInfo:重复:为我做.时间间隔是以秒为单位,每次滴答之间的“睡眠”时间,目标是持有应该调用的函数的类,选择函数. scheduledTimerWithTimeInterval:1 // Ticks once per second target:myObject // Contains the function you want to call selector:@selector(myFunction:) userInfo:nil repeats:YES (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- cocos2d-x3.5导入到android studio1.5中
- ICMAX梳理手机FLASH存储卡历史 你见过哪几种?
- react+redux+webpack+babel+npm+shell+git文章合集
- c – 在2d数组的矩形区域内快速查找最大值的方法
- 修改oracle数据库用户名及密码的方法
- 分享一个自己做的ajax请求页面
- 原生js实现对Ajax的封装(仿jquery)
- ajax – 使用wsHttpBinding时为什么InstanceContextMode.Pe
- SAX解析xml characters方法要注意的问题
- Unexpected XML declaration. The XML declaration must be