Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Preston Harris
Preston Harris
1,607 Points

Using NSTImer for a stopwatch

Is it possible to make a stopwatch application by using the NStimer method?

2 Answers

Stone Preston
Stone Preston
42,016 Points

thats the way I would do it I think. use an NSTimer along with an NSDate that stores the start time

Preston Harris
Preston Harris
1,607 Points

Ok thanks, Im out to win that forum contest!

Patrick Cooney
Patrick Cooney
12,216 Points

So, I may be too late for you to make use of this info but I'll throw it out there anyway. I added a timer to an app a while back. While I was doing research I read that it's not good practice to use NSTimer because it's not very precise. It's designed for scheduling alerts and things like that. Not keeping accurate track of time. If it's not too late I would recommend the use of NSDate using the timeIntervalSince________ methods.