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

Brendan Buckingham
Brendan Buckingham
7,836 Points

Signing Up New Users Part 1 - OR operator not working

I followed the video to exactly, and also tried the code from the sample you can download. Both give me the "Oops Make sure you enter a username, password, and email address!" even if I have all the fields filled in. Has anyone else had this issue. I've racked my brain and don't see anything obvious causing the issue. Here's my code below.

if ([username length] == 0 || [password length] == 0 || [email length] == 0) {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops!" message:@"Make sure you enter a username, password and email address!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

    [alertView show];
}

1 Answer

Brendan Buckingham
Brendan Buckingham
7,836 Points

I figured it out. My passwordField in the SignupViewController.h header file was not linked properly to the Interface. The black circle to the left was empty. I deleted that line and relinked it. Once that was complete, everything worked great.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Excellent - glad you got it working! Those can be annoying bugs to figure out.