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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-10-2009, 06:15 PM   #1 (permalink)
mapper724
Registered Member
 
Join Date: May 2009
Posts: 12
Default Need help with timer

I need help trying to figure out how to declare my countDown thingy. I need to know how and where to declare it. can anyone help me? I followed the tutorial by Nitrex88 and I just omitted the animation part of the code. and i keep getting the " 'countDown' undeclared first use in function. " error. I've included the timer part of the .m file and the entire .h file.

Code:
//Timer
-(IBAction)timeStart {
	time = 60.0;
	timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:(countDown) userInfo:nil repeats:YES];	<<<<ERROR HERE----
}

-(void) countDown {
	time = time - 1;
	if (timer == 0){
		[timer invalidate];
	}
	[self updateTimeLabel];
}

-(void) updateTimeLabel {
	timeLabel.text = [NSString stringWithFormat:@"%i Sec", time];	
}
Here's my .h

Code:
@interface iTap_Really_FastViewController : UIViewController {
    IBOutlet UILabel *timeLabel;
	NSTimer *timer;
	NSUInteger time;
	IBOutlet UILabel *tapsLabel;
	IBOutlet UIImageView *tapButton;
}


@property (nonatomic, retain) NSTimer *timer;
@property (nonatomic, retain) UILabel *timeLabel;
@property (nonatomic, retain) UILabel *tapsLabel;
@property (nonatomic, retain) UIImageView *tapButton;
-(void)updateLabelsFromTouches:(NSSet *)touches;
-(IBAction)timeStart;
-(void)countDown;
-(void)updateTimeLabel;
mapper724 is offline   Reply With Quote
 

» Advertisements
» Online Users: 617
19 members and 598 guests
ADY, Ashleyk27, Dattee, denied, falcondor, iDifferent, ilmman, john love, klrichner, mapiko, mer10, mongoose250, mylogon, peppinoss, Punkjumper, sle39lvr, smithdale87, timle8n1
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,745
Threads: 89,201
Posts: 380,564
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Ashleyk27
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.