5

I am using parse with iOS/Swift and in my PFUser class I have a field that contains an array of pointers to another PFObject class.

When I update the field via the Data Browser calling fetch on PFUser.currentuser does not retrieve this update. All other non-array fields retrieve updates however.

Is this simply an issue with Parse? Does anyone know of a workaround?

rici
  • 234,347
  • 28
  • 237
  • 341
Dave Odell
  • 51
  • 1
  • 3
  • I changed this field to be an PFRelation as opposed to an array of pointers and that seems to fix the issue. I was using the array since it works with the local datastore, but I just had to modify how I perform my queries. Still would like to know if there is a fix that allows me to use the array of pointers – Dave Odell Apr 17 '15 at 14:26

2 Answers2

0

Try PFUser.currentUser()!.fetch() in Swift or [[PFUser currentUser] fetch] in Objective-C. Calling .fetch() on a PFObject refreshes the object from the server.

mrbcg
  • 371
  • 1
  • 7
0

You have to use includeKey, all the pointers and relations, by default, doesn't fetch it all, it was made to save data by not retrieving all this data unless you want to. To tell your query to retrieve these pointers, use:

yourQuery.includeKey("yourColumnNameWithTheArrayOfPointers")

This should work just fine.