Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-18-2011, 12:36 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 1
thomisso is on a distinguished road
Post Countdown timer

Please help. I want to create countdown timer using iphone sdk. I have current time:
Code:
NSDate *today = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"HH:mm"];
NSString *currentTime = [dateFormatter stringFromDate:today];
[dateFormatter release];
and time(s) from database. Eg.: currentTime is 19:18:30, time from database is 19:20:01. So the timer should be set to 0:01:31 and begin the countdown. When reach the 0:00:00, take another time from database (eg: 19:21:00), set up timer (0:00:59) and star countdown again. When reach the 0:00:00, take... The timer should be displayed by UILabel.

Please help. It begins to make me mad.
thomisso is offline   Reply With Quote
Old 09-18-2011, 01:01 PM   #2 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 624
DenVog is on a distinguished road
Default

Quote:
Originally Posted by thomisso View Post
Please help. I want to create countdown timer using iphone sdk.
There are quite a few existing threads on this topic. I swear this was asked less than a week ago. There are also example apps online. In short, you need to get start time and end time. Compare the two. Count.

Docs you want to look at are timeIntervalSinceDate in NSDate Class Reference.

Give it a shot, and and if you can't get it working post your code.
DenVog is offline   Reply With Quote
Reply

Bookmarks

Tags
cocoa touch, iphone sdk, objective c

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 398
16 members and 382 guests
7twenty7, Eclectic, eski, EvilElf, fiftysixty, HemiMG, iOS.Lover, JackReidy, jarv, pbart, Pudding, sacha1996, teebee74, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0