Posted By


magickaito on 04/15/11

Tagged


Statistics


Viewed 167 times
Favorited by 0 user(s)

ObjectiveC NSTimer


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. .h file
  2.  
  3. // declare timer
  4.  
  5. NSTimer *countDownTimer;
  6. @property (nonatomic, retain) NSTimer *countDownTimer;
  7.  
  8. .m file
  9.  
  10. // stop the timer before it is used
  11. // this is useful sometimes if not the timer might be run twice
  12. [self.countDownTimer invalidate];
  13.  
  14. // this will create and RUN/SCHEDULE the timer all at the same time.
  15. self.countDownTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(callBackFunctionHere:) userInfo:nil repeats:NO];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.