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 trialTaylor Gendron
9,106 PointsSigning 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
42,016 PointsHere 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
Gregg Mojica
11,506 PointsThis should work: NSLog(@"%d", succeeded);
Stu Cowley
26,287 PointsWorks for me! :)
robert cioffi
3,466 PointsI'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
42,016 Pointsyou need to close your square bracket of the method call
[newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error)
{ NSLog(@"%d", succeeded) }];
robert cioffi
3,466 Pointsso simple...thanks!
Andrej Kozuharov
2,404 PointsIt 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
42,016 Pointscan you post the code you are using for the challenge
Marcus Sinna
Courses Plus Student 2,432 PointsThe solution is in the block where this code is placed. It should be in the {} immediately after the ^(BOOL cr*p)...... :)
Guy Mathieu
2,984 PointsGuy Mathieu
2,984 PointsI 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.
Stone Preston
42,016 PointsStone Preston
42,016 Pointswhoops