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

Trent Burkenpas
Trent Burkenpas
22,388 Points

My ribbit app is not running, i'm getting a error message

2014-02-04 14:49:04.318 Ribbit[7280:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SignupViewController 0x99726e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameFeild.' *** First throw call stack:

not sure 100 % what is wrong with the app...something to do with usernameField ??

THanks

16 Answers

You should just delete your label and your property and remove any connections between those two in the Connections Inspector, and then set it up properly. Usually solves whatever problems you are having.

You should check if your IBOutlet connection is working correctly. Maybe you renamed your @property? Hover over the outlet @property in your controller to see that it hightlights the correct view in your scene and check the Connections Inspector (the right-most tab in the Utilities panel (which is the right-most panel)) for faulty connections.

Sabine Geithner
Sabine Geithner
3,264 Points

Hey, this usually happens when you change the outlet name, but view that was connected to that outlet still holds the reference to the old name. Simple solution: "right click" (or ctrl click) on the item in your storyboard and remove the old outlet in the popup window by simply clicking on the cross.

Stefan Jansen
Stefan Jansen
8,974 Points

the error says that you try to add an object to a dictionary with a key that is most likely is nil. Check the part of your code where you write the value from the username field to a NSString.

Trent Burkenpas
Trent Burkenpas
22,388 Points

hmm I can't seem to find an error, I assume this si the code you are talking about

- (IBAction)signup:(id)sender {

    NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    NSString *email = [self.emailField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    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];
    }
}
Stefan Jansen
Stefan Jansen
8,974 Points

search your code for this exact string: usernameFeild and replace it with usernameField.

your issue is that you misspelled usernameField :)

Trent Burkenpas
Trent Burkenpas
22,388 Points

What I did? I dont see it lol

Stefan Jansen
Stefan Jansen
8,974 Points

Field is written with the i before the e, not after it!

Trent Burkenpas
Trent Burkenpas
22,388 Points

Yeah, thats what I did....where are you seeing the misspelling? Because im having a hard time finding it lol

Stefan Jansen
Stefan Jansen
8,974 Points

in your first post. in the error message :)

in xcode you can do shift+cmd+f to find inside a project and search for usernameFeild

Trent Burkenpas
Trent Burkenpas
22,388 Points

Im getting "NO Results for usernameFeild" Thats weird, because I see that in the error message, but every time i spelled usernameField, I spelled it correctly. I did however spelled it wrong when setting up my storyboard properties, but i corrected it. Maybe thats is why idk

Stefan Jansen
Stefan Jansen
8,974 Points

thats weird, got any possibility to zip and upload your project. I'll have a look at it.

Trent Burkenpas
Trent Burkenpas
22,388 Points

Im not sure 100% how to do that lol

Stefan Jansen
Stefan Jansen
8,974 Points

thats a possibility, but I never liked this solution. Doesn't really help with understanding what issue is and that is actually valuable information.

I get this error message from time to time, and usually it's Xcode being weird and stubborn. It's generally a result of not linking the correct custom class to the scene, changing the name of the IBOutlet or something else after you initially set the connection up.

Trent Burkenpas
Trent Burkenpas
22,388 Points

Ok yeah that worked, it must of saved the misspelled version, even though i changed it.

Great! You should mark the answer that helped you as the Best Answer so it shows up in the feed as solved.

Trent Burkenpas
Trent Burkenpas
22,388 Points

Ok yeah that worked, it must of saved the misspelled version, even though i changed it.