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

Code challenge Logging in and Logging out 3 of 4

It asks the following:

Now switch to LoginViewController.m. Blocks can also be declared and passed around as variables, as we can see in the existing code below. This code declares a block named 'loginHandler'. In the login method (after the block), add a call to the PFUser class method 'logInWithUsernameInBackground:password:block:'. Use "test" as both the username and password parameters. Then pass in 'loginHandler' as the third parameter. You can use block variables in this manner like how you would use any other variable as a parameter.

So I did:

[PFUser logInWithUsernameInBackground:@"test" password:@"test" block:loginHandler];

What is wrong?

UPDATE: So I realised I was writing the code IN the block and not AFTER it.... Sorry!

1 Answer