I was wondering whether there is a solution to raise an event once after 30 seconds or every 30 seconds in CocoaTouch ObjectiveC.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
Take a look at the
NSTimer
class:Somewhere else you have the actual method that handles the event:
Documentation
You may also want to look at the other
NSTimer
methodsThere are a number of options.
The quickest to use is in
NSObject
:(There are a few others with slight variations.)
If you want more control or to be able to say send this message every thirty seconds you probably need
NSTimer
.The performSelector: family has its limitations. Here is the closest setTimeout equivalent:
EDIT: A couple of projects that provide syntactic sugar and the ability to cancel execution (clearTimeout):