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

iOS

Adding New Users Part 2 Task 2

Question asks: Next, create a new PFUser variable named 'newUser' and initialize it using the 'user' class method from PFUser. Set the 'username' and 'password' properties of this user using the properties you just set.

I've written the following code:

PFUser *newUser = [PFUser user];
newUser.username = username;
newUser.password = password;

What am I doing wrong here - I cannot figure it out!!

2 Answers

It says to set the username and password using the properties you just set . Try using

newUser.username = self.username

And the same with password

I can't remember the exact question, but I think it was something as silly as username with an upper case N , so userName.

Hope that helps!

That didn't work. Any other ideas?

Late to the Party i know....

@implementation SignupViewController

- (IBAction)signup:(id)sender {
self.username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
self.password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

PFUser *newUser = [PFUser user];
newUser.username = self.username;
newUser.password = self.password;
}