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

Taylor Gendron
Taylor Gendron
9,106 Points

Signing Up New Users Part 2 - PFUser // Build a Self-Destructing Message iPhone App - Challenge 4 of 4 - Ribbit

For now, inside the block, simply log the 'succeeded' parameter using NSLog. BOOL values are really just int values (0 or 1), so you can use the int format specifier: %d. Remember: format specifiers are placed in between the double quotes of an NSString literal, and then the values to be plugged in are specified after the NSString, separated by commas.

I'm blond..

6 Answers

Stone Preston
Stone Preston
42,016 Points

Here is a hint: this is what a NSLog with a format specifier usually looks like:

NSLog(@"%d", myVariable);

It tells you what specifier to use (%d), so you should be able to figure it out now

I think you have an extra quotation mark there my friend. the correct format ought to be:

NSLog(@"%d", myVariable);

NOT

NSLog(@"%d", myVariable");

as for myself, NSLog(@"%d", succeeded); is the code that worked.

This should work: NSLog(@"%d", succeeded);

Works for me! :)

robert cioffi
robert cioffi
3,466 Points

I'm using this, but it doesn't appear to work, does anyone see why?

[newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { NSLog(@"%d", succeeded) };

Stone Preston
Stone Preston
42,016 Points

you need to close your square bracket of the method call

 [newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) 
   { NSLog(@"%d", succeeded) }];

It doesn't work for me. This one should be rather easy, like Gregg said but I'm afraid I'm missing something. I just can not get it right. If it is only "succeeded "we have to log than I have no clue besides NSLog(@"%d", succeeded); solution which is clearly not the solution.

Stone Preston
Stone Preston
42,016 Points

can you post the code you are using for the challenge

The solution is in the block where this code is placed. It should be in the {} immediately after the ^(BOOL cr*p)...... :)