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

Liam Brady
Liam Brady
9,713 Points

'Retrieving and Viewing Data from Parse' Code Challenge

Challenge: We saw that we can get specific objects from the Parse back-end using 'getObjectInBackgroundWithId:block:'. Pass that message to the 'query' variable to retrieve an object with the ID "1" (it's an NSString). Just pass in 'nil' for the block parameter in this step (we'll fix that next).

My Code:

PFQuery *query = [PFQuery queryWithClassName:@"Move"];

// Insert code here!

[query getObjectInBackgroundWithId:@"1" block:nil {

} ]; 

I've tried many variations on this theme and just can't seem to get in. I'm sure it will be obvious where I've got wrong once someone points it out.

2 Answers

It says Just pass in 'nil' for the block parameter in this step (we'll fix that next). which I see you did, but then you added curly brackets { }. A block is like this ^{ }, but it says to just set it to nil. The curly brackets don't make sense for nil as it is not a block. So just remove the curly brackets and you should be fine.

Liam Brady
Liam Brady
9,713 Points

Thank you very much, Erik. That was exactly what I needed!

You look like you're making great progress on Treehouse!

Thank you again.