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!

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

Signing up new users part 1 app quits when trying to sign up

New to Xcode and objective-c. When I run the app and enter info into the username/password/email fields then click "sign up" the app quits with a message in output box "unknown class PFSignUpView in interface builder".

sooooooo, I'm still here playing with it 4 hours later. Still no progress or help from any online forums. But I've managed to add to the problems, now when I try to push "sign up" in the simulator I get:

Unknown class PFSignUpView in Interface Builder file. -[UIView text]: unrecognized selector sent to instance 0x893f9e0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView text]: unrecognized selector sent to instance 0x893f9e0' *** First throw call stack: (0x1fb0012 0x1d23e7e 0x203b4bd 0x1f9fbbc 0x1f9f94e 0x2cd3 0x1d37705 0xe942c0 0xe94258 0xf55021 0xf5557f 0xf546e8 0xec3cef 0xec3f02 0xea1d4a 0xe93698 0x2a61df9 0x2a61ad0 0x1f25bf5 0x1f25962 0x1f56bb6 0x1f55f44 0x1f55e1b 0x2a607e3 0x2a60668 0xe90ffc 0x27bd 0x2285) libc++abi.dylib: terminate called throwing an exception (lldb)

someone please help!!

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Jared,

That error sounds like the Parse SDK was not added correctly to your project. I'd recommend going back to the previous video and making sure that everything is added correctly.

You could also download the project files from the "Project Files" link on the right side of the page under the video. The files give you the completed code for the end of the stage, and you could use them to compare with your own to see if any code or settings are different.

As a side note, since you say you are new to Xcode and Objective C, you might want to work through the Beginner (Crystal Ball) and Intermediate (Blog Reader) level projects before tackling this advanced one. We make some assumptions about your experience that probably makes this project harder to follow for a beginner. Either way, we're here to help!

That's exactly what it was, I had managed to work through it myself by reworking things again. Now, however, I am to the end "relating users on parse.com" and have again encountered a snag. When I click to deselect friends in the editfriendsviewcontroller, they are not being unchecked. I cross referenced the rabbit code with my own and could not find any differences. I also checked the data manager on parse to see if they were being removed and there was no change there either. I also did a fresh clean, build, and reboot of the system with no success. Thanks again in advance! I love this treehouse program, it's great!

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Progress! Okay, for this next one, can you put some breakpoints in your didSelectRowAtIndexPath method inside EditFriendsViewController.m? You'll want to check that the code executes as you intended. Let me know how that goes and we can go from there. If you can, please paste in that whole method in your reply for reference.

Okay, I put breakpoints in and analyzed the results but still couldn't find anything. I'm probably missing some minor detail somewhere. I've managed to get the rest of the app running fine, including the steps after this one. Anyhow, here's my method:

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

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    PFRelation *friendsRelation = [self.currentUser relationforKey:@"friendsRelation"];
    PFUser *user = [self.allUsers objectAtIndex:indexPath.row];

    if ([self isFriend:user]) {
        cell.accessoryType = UITableViewCellAccessoryNone;

        for(PFUser *friend in self.friends) {
            if ([friend.objectId isEqualToString:user.objectId]) {
                [self.friends removeObject:friend];
                break;
            }
        }

        [friendsRelation removeObject:user];
    }
    else {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
        [self.friends addObject:user];
        [friendsRelation addObject:user];
    }

    [self.currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if (error) {
            NSLog(@"Error %@ %@", error, [error userInfo]);
        }
    }];

}
Ben Jakuben
Ben Jakuben
Treehouse Teacher

Your code matches mine perfectly. If the checkmarks are not being removed, then maybe it never gets in the if block of that code? Perhaps it's a problem with your isFriend method. Take a look at that (insert some more breakpoints during debugging) and also post it in here for us to review.