1

I intend to write an iOS app to retrieve objects from Parse. The documentation shows you how to retrieve a particular object (with certain id). But I want to retrieve objects based on a particular field in the table.

How do I do it?

1
  • You just create a query and add boundaries or limits to the query like whereKey:@"username" isEqual: parse is well know for the documentation. They have everything written out for you from a-z just take a look Commented Dec 11, 2014 at 22:20

1 Answer 1

1

Something like this:

PFQuery *query = [PFQuery queryWithClassName:@"GameScore"];
[query whereKey:@"playerName" equalTo:@"Dan Stemkoski"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
  if (!error) {
    // The find succeeded.
    NSLog(@"Successfully retrieved %d scores.", objects.count);
    // Do something with the found objects
    for (PFObject *object in objects) {
        NSLog(@"%@", object.objectId);
    }
  } else {
    // Log details of the failure
    NSLog(@"Error: %@ %@", error, [error userInfo]);
  }
}];

https://www.parse.com/docs/ios_guide#queries-basic/iOS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.