I am querying both the local data store and the server for PFObjects
. To try and save mobile data usage and networking usage, the data is first looked up in the local data store and then whatever has not been found is looked up on the server.
The code to figure out which PFObject
s have not been found yet is:
let response = objects as! [PFObject]
var responseObjectIds = [String]()
for x in response {
responseObjectIds.append(x.objectId!)
}
query.whereKey("objectId", notContainedIn: responseObjectIds)
This seems to work fine with normal queries, but breaks down when trying to do the same thing with queries created from Relations
.
I think I read somewhere that the whereKey
method implementations are slightly different for Relation
queries, but I don't think it is very well documented.
Any help improving the code or suggesting new solutions would be greatly appreciated.