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 Build a Self-Destructing Message iPhone App Using Parse.com as a Backend and Adding Users Logging In and Logging Out

Taylor Shaw
Taylor Shaw
472 Points

SIGBRT error

I am about 6 minutes into the video and I have watched it several times and copied it space by space and I still get a SIGBRT error. I get [<LoginViewController 0x9aefc50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Login.' every time I try to run it. How do I properly define the key?

Taylor Shaw
Taylor Shaw
472 Points
  • (IBAction)Login:(id)sender { NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

if ([username length] ==0 || [password length] ==0) { UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"slow down!" message:@"Make sure you enter a username and password!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertview show]; } else { [PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {

        if (error) {
            UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"Sorry" message:[error.userInfo objectForKey:@"error"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

            [alertview show] 
        }
        else {
            [self.navigationController popToRootViewControllerAnimated: YES];
        }
    }];
}

}

7 Answers

Bradley Maskell
Bradley Maskell
8,858 Points

Nevermind. If you have this problem go to > main.storyboard > InboxViewController > outlets and look for the one outlet connection that has an exclamation point. Delete it and your app should work fine.

Mike Baxter
Mike Baxter
4,442 Points

Do you happen to have any instance variables named "Login"? If so, then you can't name your IBAction "Login". Try renaming your action (and of course, redo the connection in Interface Builder) and see if that works.

Taylor Shaw
Taylor Shaw
472 Points

Not that I know of I used all of the code for Login and did not see anything that would cause the error. I changed the named and reconnected the view controller several times trying the names signin, start and jim. I am still getting the "[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Login."

Taylor Shaw
Taylor Shaw
472 Points

It also says NSexception (lldb) in the debugger pane if that helps?

Mike Baxter
Mike Baxter
4,442 Points

Maybe try the advice from Stackoverflow for a similar error message:

"Check your connections in Interface Builder. You're probably referring to a non existent IBOutlet or IBAction." - from Gabriele Petronella

Bradley Maskell
Bradley Maskell
8,858 Points

I'm getting the same warning. I'm not referring to a non existent IBOutlet or IBAction. I downloaded the teachers project files and ran them in Xcode and they match perfectly and even the teachers code doesn't work. Please help.

The example files function well provided you have the latest frameworks installed.

Hint: Delete Parse.framework and add the new version from parse.com