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

code challenge: sign up users

i have no idea what im doing wrong, it say make sure you set both user name and password properties.

#import "SignupViewController.h"
#import <Parse/Parse.h>

@implementation SignupViewController

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

}

@end

any help would be good.

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

username and password are properties of 'SignupViewController', so declaring them as new NSString variables gives you the Compilation Error.

so how do i make them not properties of SignupViewController

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Well, in a real app that would depend on whether or not they should be properties. (In this code challenge the assumption is that they need to be properties for some reason.)

So what you need to do instead is figure out how to reference them instead of declaring new NSString variables. Here's a hint: usernameField and passwordField are also properties. :smile:

I do not understand how to reference these without using NSString which does not work. Can you please help?

Thanks,

Adam

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Adam,

username and password are properties that are already defined in the header file for this class (meaning they are declared with something like @property (nonatomic, strong) NSString *username;).

All you need to do is reference them as properties of the current class. For an example, check out how usernameField and passwordField are referenced as properties in the code sample in the original question.

there i got now im on 3/4 thank you so much