Get Updates By E-mail 

Article Written By:
Johann Dowa

iPhone Objective-C Programming NSTimer

  •  
  •  
  •  
  •  
  •  

In the course of your iPhone Objective-C programming you will likely have the need for an NSTimer at some point so it’s good to have an understanding of how they work.

I found this good example here on timers: NSTimer the Poor Man’s Threading Code Snapshot

While it’s foolishly titled a Poor Man’s Threading which may give you the impression that timer and thread are synonymous it shows a nice flashy example of NSTimer’s in action.  If you’re looking for the Cocoa threading class you will want to look up NSThread which I will be featuring in an upcoming tutorial.

Something to take note of with timers is that they can be highly inaccurate so if you end up having multiple timers firing in sequence you may want to check the time index and adjust the length of your timer approperiately to produce more consistent results.

Check it out, and if you’re having trouble with timer’s you might want to play around with it.

[Source: iCodeBlog]


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments