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 trialTossy Kelly
Courses Plus Student 2,069 Pointscannot 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
9,372 PointsThe 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;
}
Alex Cevallos
16,551 Pointshey there! remove the * from *username and *password and try that, could you post the question again?
Soojin Ro
13,331 PointsWhat's with the "objective c" in the beginning?
Gareth Borcherds
9,372 PointsThe 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.