Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DIGITALiam

macrumors newbie
Original poster
Hey I'm making a timer app that has both minutes and seconds. To do this I am using two different labels. How can I make sure it is always two digits (10:01 not 10:1).

Thanks in advance.
 
If the number is less than 10 put a 0 in front of it. Just always convert the int to NSString and put it in the label that way.
 
The only other reasonable way I can think of doing it would be to use a formatter. But admittedly I'm still working my way through the API so that might not be viable.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.