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 trialdrewmeador
2,805 PointsHelp with code challenge
#import "SignupViewController.h"
#import <Parse/Parse.h>
@implementation SignupViewController
- (IBAction)signup:(id)sender {
NSString *username = self.usernameField.text;
NSString *password = self.passwordField.text;
}
@end
I have also tried the stringWithTrimmingCharactersInSet similar to the previous video and that one doesn't work either. Is it not working because I am trying to store the values as strings?
3 Answers
Elias Thanasopoulos
32,286 Pointscan you try this:
'- (IBAction)login:(id)sender { NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; }'
Ezequiel Amaya
3,094 PointsAre the textFields on the viewController in the storyboard connected to the properties on the .h file? This link https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/ManageTextFieldTextViews/ManageTextFieldTextViews.html could be of some for you in how to use textFields.
drewmeador
2,805 PointsI figured out the answer I just had one question regarding this. In the video Ben assigned the username and password to a string. If I use the following code what is it being stored as? Does the .text make it a string?
self.username = self.userNameField.text;
drewmeador
2,805 Pointsdrewmeador
2,805 PointsYes, I did try this as well since this is the way it was done in the previous video but I get the feed back Bummer! Make sure you set both the 'username' and 'password' properties!