Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-10-2009, 05: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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,350
Threads: 39,142
Posts: 171,612
Top Poster: smasher (2,577)
Welcome to our newest member, 17make
Powered by vBadvanced CMPS v3.1.0

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