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

Eliot Winchell
8,341 PointsCode challenge won't accept my answer - Adding the Edits Friends Screen 2/3 iOS
Stuck stuck stuck. Entered my answer and it looked correct but I keep getting an error that the syntax is wrong. I looked on the forums and comparing answers and mine should be correct. It is late at night so maybe I'm missing something blatantly obvious but I don't think so. I have to go sailing tomorrow morning so maybe it's a good idea that I get some sleep, thank you treehouse god haha
Question: Now send the 'findObjectsInBackgroundWithBlock' message to the 'query' variable. Use the code that is commented out as the basics for the block you pass in.
My Answer:
#import "AppsViewController.h"
#import <Parse/Parse.h>
@implementation AppsViewController
- (void)viewDidLoad {
[super viewDidLoad];
[PFQuery queryWithClassName:@"Apps"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (error) {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
else {
}
}];
}
@end
P.S. Amit Bijlani Ben Jakuben thanks for the amazing iOS courses. At first I was extremely confused but you guys explain it so well and once I start working on my own apps I'm going to have such a better foundation thanks to you guys! :)
4 Answers

Meek D
3,457 Pointsthe answer is
[PFQuery queryWithClassName:@"Apps"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if(error)
{
NSLog(@"Error %@ %@ ",error,[error userInfo]);
}
else{
self.Apps=objects;
}
}];

Mark Heckman
3,636 PointsI am having the same problem with the challenge not accepting my code. Here is what I have tried to enter.
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (error) {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
else {
}
}];
}
@end

Meek D
3,457 Pointsyou are missing that line [PFQuery queryWithClassName:@"Apps"]; and a curly bracket at the end try to run to Xcode and then copy it and paste it to treehouse compiler

Mark Heckman
3,636 PointsI didn't include the [PFQuery queryWithClassName:@"Apps"] code here since I knew that part of the challenge wasn't my issue. My error ended up being caused from bad syntax on my part. One of my curly brackets was in the wrong spot.
Thanks to everybody for getting back to me! Time to finish up this app :)

Meek D
3,457 PointsAdmit I got some questions how can I reached please
Eliot Winchell
8,341 PointsEliot Winchell
8,341 PointsStill doesn't work.
Amit Bijlani
Treehouse Guest TeacherAmit Bijlani
Treehouse Guest TeacherYou are almost right but the first question asks you to create a variable named
query
. None of the answers here have created a local variable namedquery
and then assign it[PFQuery queryWithClassName:@"Apps"];