Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialhunche
3,339 PointsChallenge task 4 of 4Now just send a message to the 'alertView' to show it to the user!
I take over challenge task 1 to 3 of 4, but I stuck on 4 of 4: I don't has any ideal to solve it following thchallenge's guide
import "NumberGuesserViewController.h"
import "GuessEngine.h"
import "UIAlertView.h"
@implementation NumberGuesserViewController
- (IBAction)makeGuess:(id)sender { NSString userNumber; userNumber = self.numberField.text; // Check to see if the user's number is correct BOOL isCorrect = [GuessEngine testGuess:userNumber]; if (isCorrect) { UIAlertView alertView=[[UIAlertView alloc]initWithTitle:@"Hooray!" message:@"You did it!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; // Should I modify this line ????????? [alertView show]; }}
@end
2 Answers
Caleb Kleveter
Treehouse Moderator 37,862 PointsIs this what you put in?
@implementation NumberGuesserViewController
(IBAction)makeGuess:(id)sender { NSString userNumber; userNumber = self.numberField.text; // Check to see if the user's number is correct BOOL isCorrect = [GuessEngine testGuess:userNumber]; if (isCorrect) { UIAlertView alertView=[[UIAlertView alloc]initWithTitle:@"Hooray!" message:@"You did it!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; // Should I modify this line ????????? [alertView show]; }}
@end
hunche
3,339 PointsYes, I put in so many . Now just send a message to the 'alertView' to show it to the user! How should I do to take a brief for send a message
james white
78,399 PointsThe link to the 4 part challenge:
The line needed for part 4 of 4 is simply:
[alertView show];
See this forum thread if you need help up with 2/3 of 4: https://teamtreehouse.com/forum/code-challenge-3-of-4-build-a-selfdestructing-message-app-trouble
Part 1 of 4 (the line in the NumberGuesserViewController.h:
@property (strong, nonatomic) IBOutlet UITextField *numberField;
Meek D
3,457 PointsMeek D
3,457 Pointswhat do you need help with because i don't really understand your question