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

General Discussion

Help with debugging an error

2014-02-13 13:47:14.863 Ribbit[23778:70b] -[SignupViewController passwordField:]: unrecognized selector sent to instance 0x9a6d230 (lldb)

I keep getting this message. When I switch fields in a signup page. I have username password and email. I enter username and password perfectly but when i click email the thing just shuts down and stops

13 Answers

Stone Preston
Stone Preston
42,016 Points

ive fixed your problems! i removed your text field connections, then re added them and its working now. You had a few unnecessary actions connected to the email and password text fields for some reason (didEndEditing and a few others) that were causing problems. you can fix it yourself by removing your text field connections on your sign up view controller and deleting the declarations in your .h for sign up, then just reconnect everything and name them usernameField, passwordField, and emailField and it will work.

how do i go about doing this or can u send me back the edited file

Stone Preston
Stone Preston
42,016 Points

ill send it back to you

how r u doing this since gmail wont work

Stone Preston
Stone Preston
42,016 Points

uploading to dropbox one sec

no problem

Stone Preston
Stone Preston
42,016 Points

https://www.dropbox.com/s/gr64bv50d3o48nh/Ribbit%20Fixed.zip

It was a relatively simple problem that was hard to diagnose without actually looking at the project and the connections. I noticed you had some weird actions connected to your text fields (instead of just the outlet connections you had a few more) removed your text field connections and re added and it doesnt crash anymore. Isnt debugging fun!

is this going to mess up my parse thing though because its a different file

Stone Preston
Stone Preston
42,016 Points

eh it shouldnt. But if I were you I would just do what I Did in your own project. remove all the outlet connections and actions associated with your text fields in the connections inspector of your signup view controller (on the far right of xcode in the utiities view with your view controller selected press the arrow button at the top to view connections). delete anything that has to do with your text fields. including actions (but not your sign up button action). then delete the outlet declarations for your textfields in your .h, then add the connections again by control clicking and dragging from each text field to your .h

i jsut looked at your file and took what you took out and then did the same on my file

Stone Preston
Stone Preston
42,016 Points

alright is it working?

is it weird that all i had to do was that first step. I didnt have to control click and drag in the .h file and its working apparently fine no errors

Stone Preston
Stone Preston
42,016 Points

not sure. i would connect it if i were you just to be safe.

can i ask you one more question?

on the last } at the bottom. it keeps saying control reaches end of non-void function how do i fix this?

pragma mark - Table view delegate

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.tableView deselectRowAtIndexPath:indexPath animated:NO];

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType =UITableViewCellAccessoryCheckmark;

    PFUser *user = [self.allUsers objectAtIndex:indexPath.row]; PFRelation *friendsRelation = [self.currentUser relationForKey:@"friendsRelation"]; [friendsRelation addObject:user]; [self.currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (error) { NSLog(@"Error %@ %@", error, [error userInfo]); } }]; }

pragma mark - Helper methods

  • (BOOL)isFriend:(PFUser *)user {

}

@end

Stone Preston
Stone Preston
42,016 Points

ok your isFriend method has a return type of BOOL, which means inside the method you will have to return a BOOL. If you are following along in the videos im sure it does this at some point so just keep watching.

in the video however it does not have error at this point

do u see any error?

Stone Preston
Stone Preston
42,016 Points

well yes, the error is your function has a return type of bool and you arent returning anything. Thats what the control reaches end of non void function means, it gets to the end without there being anything returned. but if ben doesnt have anything in that method at this point just keep following along and it will be implemented correctly.

its the } before the @end

i fixed my other problems but in the create your own destroying messaging app. I have an error with the line self.videoFilePath = [[info objectForKey:UIImagePickerControllerMediaURL] path]; It says implicit conversion of C pointer type 'CGPathRef (aka 'const struct CGPath *) to Objective-C pointer type 'NSString *' requires a bridged cast. What does this mean?

Stone Preston
Stone Preston
42,016 Points

see the teachers notes in this video. it mentions splitting that line into two parts.

replace

self.videoFilePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];

with

NSURL *imagePickerURL = [info objectForKey:UIImagePickerControllerMediaURL]; self.videoFilePath = [imagePickerURL path];