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

View Single Post
Old 09-04-2010, 03:04 PM   #69 (permalink)
phillipie99
Registered Member
 
Join Date: Jul 2010
Posts: 196
phillipie99 is on a distinguished road
Default

Quote:
Originally Posted by gatorcade View Post
Did not work for me. Could you please help?

(Quiz game view controller.h):

-(void)checkAnswerint)theAnswerValue;
-(void)askQuestion;
-(void)updateScore;
-(void)loadLevelOne;
-(void)countDown;
-(void)reset;

@end

Quiz game view controller.m file:


-(void)updateScore
{

questionLive = NO;

[timer invalidate];


[answerOne setHidden:YES];
[answerTwo setHidden:YES];
[answerThree setHidden:YES];
[answerFour setHidden:YES];
NSString *scoreUpdate = [[NSString alloc] initWithFormat:@"%i", myScore];
theScore.text = scoreUpdate;
[scoreUpdate release];

// END THE GAME.
NSInteger endOfQuiz = [theQuiz count];
if((((questionNumber - 1) * 6) + 6) == endOfQuiz)
{

if(myScore > 0)
{
NSString *finishingStatement = [[NSString alloc] initWithFormat:@"You scored %i!", myScore];
theQuestion.textColor = [UIColor colorWithRed:0 green:0.2 blue:0 alpha:1.0];
theQuestion.text = finishingStatement;
[finishingStatement release];
}
else
{
NSString *finishingStatement = [[NSString alloc] initWithFormat:@"You scored %i.", myScore];
theQuestion.textColor = [UIColor redColor];
theQuestion.text = finishingStatement;
[finishingStatement release];
}
theLives.text = @"";


restartGame = YES;
[answerTwo setHidden:NO];
[answerTwo setTitle:@"Restart" forState:UIControlStateNormal];

}
else
{

time = 3.0;


timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countDown) userInfo:nil repeats:YES];
}
}

// RESET METHOD
-(void)reset {

[self viewDidLoad];


}
You screwed up this part

Code:
		
		// Make button 1 appear as a reset game button
		restartGame = YES;
		[answerOne setHidden:NO];
		[answerOne addTarget:self action:@selector(reset)forControlEvents:UIControlEventTouchDown];
		[answerOne setTitle:@"Restart the game" forState:UIControlStateNormal];
__________________
My new app Catch The Coconut.
Website: PhilBystricanApps.com
phillipie99 is offline   Reply With Quote
 

» Advertisements
» Online Users: 398
7 members and 391 guests
Absentia, Chickenrig, dennisnederlof, Domele, earnestarvizo, ipodphone, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,580
Threads: 94,082
Posts: 402,769
Top Poster: BrianSlick (7,990)
Welcome to our newest member, earnestarvizo
Powered by vBadvanced CMPS v3.1.0

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