Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Self-Destructing Message iPhone App Using Parse.com as a Backend and Adding Users Signing Up New Users: Part 2 (PFUser)

cannot set username and password from text field inputs

create a user, stage 1 of 4 challenge: Tree House compiler does not accept my solution. '''objective c NSString *username = self.usernameField.text; NSString *password = self.passwordField.text; '''

3 Answers

Gareth Borcherds
Gareth Borcherds
9,372 Points

The challenge doesn't tell you to create a NSString named password and username and store the values to it, it tells you to store the values in properties named username and password, which means that in our .h file we would have something like:

@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *password;

So that means we simply need to access that property and set it's value, just like you are doing, but just do it to the properties already created for us. (I know it's confusing...)

- (IBAction)signup:(id)sender {
    self.username = self.usernameField.text;
    self.password = self.passwordField.text;

hey there! remove the * from *username and *password and try that, could you post the question again?

Soojin Ro
Soojin Ro
13,331 Points

What's with the "objective c" in the beginning?

Gareth Borcherds
Gareth Borcherds
9,372 Points

The objective-c comes from trying to use markdown unsuccessfully, it looks like she used an apostrophe instead of a back tick to create the code blocks that I created below.