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 trial
Chelsea C.
Full Stack JavaScript Techdegree Student 3,392 PointsSelf-Destructing Messaging App authorization trouble
I've followed everything in the tutorial so far and its going well, however when I go to sign a user up, it tells me, "Sorry! Unauthorized" It's coming from my else {} condition, I know that. But I'm not sure what's wrong and why it's doing that.
Any ideas would help! Thanks
Here's my code for the else{}
else {
PFUser *newUser = [PFUser user];
newUser.username = username;
newUser.password = password;
[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];
}
}];
}
}
MODERATOR Edited: Added Markdown to the post, so the code is properly formatted and readable in the Forum Post. Please Refer to the Markdown Cheatsheet for how to post code in the Community Forums.