0

I am working on an iOS app, running on Parse(backend).

I am having problems with accessing the contents of another class from a query I made.

So I have this table. Let's call it "Contests". it has the following data: name, date start, date end, pointer to organization table (the objectid)

And then the organization table: name, number of Facebook likes,

I want to be able to access the name of the organization and every other detail a certain contest has. Will I have to put a query inside another query, slight problem with that is that the queries require waiting time and it accomplishes it in the background. So I have:

findInBackground() {
   findInBackground() {
   }
}

Is there any better way to do this? Also I am getting multiple objects at the same time.

1 Answer 1

3

You need to do a query on your Contest table with whatever requirements you have but then add an includeKey call:

var query = PFQuery(className:"Contests")

//...Other query requirements

query.includeKey("organization")
query.findObjectsInBackgroundWithBlock {
}

includeKey will force fetch of the organization along with the contest details in 1 query.

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

1 Comment

Hi! The "organization" is the table name right? How do I access the name attribute?

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.