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 trialNavneet Kumar
Front End Web Development Techdegree Student 8,838 Pointswhen signing up .... simulator says an error "invalid email address"
please help me out with this,
6 Answers
Gary Luce
7,153 PointsCan you post your code?
Navneet Kumar
Front End Web Development Techdegree Student 8,838 Points(void)viewDidLoad { [super viewDidLoad]; }
-
(IBAction)signup:(id)sender {
NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *email = [self.emailField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([username length] == 0 || [password length] == 0 || [email length] == 0) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops" message:@"Enter Usename, password, email!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } else { PFUser *newUser = [PFUser user];
newUser.username = username; newUser.password = password; newUser.email = email; [newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (error) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:[error.userInfo objectForKey:@"error"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } else { [self.navigationController popToRootViewControllerAnimated:YES]; } }];
} }
Gary Luce
7,153 PointsThat's weird, I dont see what's wrong with your code. You do seem to have one extra closing bracket but I would guess that your xcode would not compile if that was an issue. If you can upload your project, I can download it and have a look.
Navneet Kumar
Front End Web Development Techdegree Student 8,838 Pointsplease give me your personal email address so that i can forward the zip file to you for furthur assistance. thank you.
franckdacosta
1,098 PointsHello, Did anyone get a resolution on this one ?
Actually nothing is written on Parse, and I do not know if the error is coming from Parse or Xcode,
Thanks
Matt Barth
5,060 PointsCheck to see that your email field is labeled properly on your storyboard as "emailField"
Navneet Kumar
Front End Web Development Techdegree Student 8,838 PointsNavneet Kumar
Front End Web Development Techdegree Student 8,838 Pointsuploaded the code below.... please help me apas . Thank You.