0
votes

I am writing an iOS app with Swift using Parse.

In my User table, I have a pointer field called UserAddress which is pointing to an Address table record. I would like to pull this Address data for current user. I did a bit of research and figured out fetching in background is an option but I would like to avoid it. Is there an alternative to pull this data without running extra fetch work?

What I can imagine is:

  • Fetching pointer data in AppDelegate before the app gets ready to use for users.
  • Somehow, force to set includeKey when loading a currentUser

Any of the above is feasible? Please advise me.

1

1 Answers

1
votes

You correctly understand the two options, and they are the only two options. For non-user objects, usually includeKey() on a query is the way to go.

For the current user, since you have the user already, it would seem a little strange to query the user, including the pointer, just to avoid fetching the pointer, but that would work. You might be better off working on whatever's making you hesitant to do the fetch().