As far as I can tell, the only reason you might use an array of pointers is to preserve ordering, as a PFRelation instance does not support ordering. Otherwise, they appear to behave identically, albeit PFRelation is more scalable and also has a nifty built-in 'query' method to restrict a query just to the objects in the PFRelation instance, which is super helpful sometimes.
PFRelation *relation = ...
PFQuery *query = [relation query];
Context: I am building an app in which each PFUser instance HAS MANY TennisGame instances (could be a large number), and the TennisGame instances HAS MANY PFUser instances (either 2 or 4, depending on whether it was a singles game or a doubles game).
Question: What is the best way to organise my data on parse.com ? I was considering a PFRelation in my PFUser class (to TennisGame instances), as well as an array or 2 or 4 pointers in my TennisGame class (to PFUser instances). But do I need both? If not, which is best?
The question is about how you access your data. For your case, you can think about these questions:
include
on queries. You can't do include
with relations and you need to do one more query to access a user's TennisGames.I suggest you to watch this video about Parse relationships from Parse developer days.
Moreover, you don't need the keep the relationship in both sides. This would make it more complicated to create and update them.