Math_GameViewController

Math_GameViewController - / / / / / / /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// MathGameViewController.m // MathGame // // Created by Student Student on 9/27/10. // Copyright kennesaw State university 2010. All rights reserved. // #import "Math_GameViewController.h" @implementation Math_GameViewController //creates accesor and mutator methods @synthesize answerField; @synthesize question; @synthesize statusText; @synthesize correctImage; @synthesize wrongImage; int num1; int num2; //action method for hiding keyboard when "Done" is pressed -(IBAction)textFieldDoneEditing:(id)sender { [sender resignFirstResponder]; } //action method for background tap when on number keyboard -(IBAction)backgroundTap:(id)sender { [answerField resignFirstResponder]; } -(IBAction)buttonpressed:(id)sender { [answerField resignFirstResponder]; int answer = [answerField.text intValue]; int ans = num1 + num2; if (answer == ans) { correctImage.hidden = NO; wrongImage.hidden = YES; statusText.text = [[NSString alloc] initWithFormat:@"Your answer is correct "]; } else { wrongImage.hidden = NO;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/22/2011 for the course COMP 3201 taught by Professor Staff during the Spring '09 term at Kennesaw.

Page1 / 3

Math_GameViewController - / / / / / / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online