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

Thomas Skjelstad
Thomas Skjelstad
11,541 Points

Ribbit Code Challenge - Signing Up New Users Part 2 : Task 3 of 4

Stuck again. I can not make this to work. I have tried many different combinations. This should work.

Now let's use the 'signUpInBackgroundWithBlock' method to sign up this new user. Send this message to the newUser variable. For the block parameter, copy and paste the following empty block: ^(BOOL succeeded, NSError *error) {}

Here is my code

[newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if  (error) {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:           [error.userInfo objectForKey:@"error"] delegate:nil cancelButtonTitle:@"OK"    otherButtonTitles:nil];
            [alertView show];
        }
    }];

3 Answers

I don't know how a missing curly bracket could have been the answer to the question. I tried very variation that i could think of but in the end, it turned to be extremely simple. here's the code that worked for me:

[newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {}];

This worked for me too Guy Mathieu so cheers for that buddy!

Brian CI
Brian CI
28,971 Points

I really need a coffee !!! Thanks for that.

Christer Nordbø
Christer Nordbø
2,133 Points

Hi Thomas,

Maybe your going a little fast here?

Try to do what the code challenge is telling you to do, and nothing more. :)

Thomas Skjelstad
Thomas Skjelstad
11,541 Points

Do you have a hint? I have tried pretty much everything. Either i must be tired or not understanding the task. Maybe both.

Christer Nordbø
Christer Nordbø
2,133 Points

I was hoping my answer could be a hint to you! Maybe im tired too ^^,

Another hint: "Its easier then what you have done"

I will re-do the code challenge for now, just so i dont mistake it for another.

Thomas Skjelstad
Thomas Skjelstad
11,541 Points

Damn, how can i have missed that. I was missing a } before my @end somehow i must have deleted it by mistake.

It worked now. Your hint was very good. Thank you for your help.

Christer Nordbø
Christer Nordbø
2,133 Points

Say what? The pasted code above is not missing any curly brackets. I believe that must have been a bug in the code challenge! As that was not what i was aiming for ^^, / your error.

Think of it this way - dont think too much about whats done in the application your building! Dont copy paste any code. The codechallenge will give you all the information you need to complete any questions, all you have to do is remember some of the stuff from the video shown.

But anyway, glad you got trough!

By the way, IF you reach the end of the next stage (stage 3) before you go to bed could you see if you experience this issue:

https://teamtreehouse.com/forum/ribbit-addremove-friends

and add a comment to it.

Thanks :)

Thomas Skjelstad
Thomas Skjelstad
11,541 Points

I will have a look and let you know.

It will not take that long for me to get there i hope.