I have a Meal object that stores pointers to n created objects "FoodInfo" using the key "MealItems".
When I query for the meal I take advantage of the [query includeKey:@"MealItems"] to fetch the items pointed to while fetching the "Meal".
This works swimmingly if the objects are created while online (ie. all are stored in the cloud db).
However, since I cannot assume access to the cloud at all time for this app I am now trying to enable the local datastore so I've changed my queries to use: [query fromLocalDatastore];
and I've changed all of my objects' save methods to pinInBackgroundWithBlock followed by (assuming success of local save) saveInBackgroundWithBlock followed by (assuming failure) saveEventually.
To test this, I:
- turned off wifi
- ran the code to create a meal and then add newly created foods to it. This works with no error codes.
- ran a report that then queries for the meal just created. This fails with the following:
Error: Error Domain=Parse Code=121 "include is invalid for non-ParseObjects" UserInfo=0x60800007f400 { error=include is invalid for non-ParseObjects, NSLocalizedDescription=include is invalid for non-ParseObjects, code=121 } { NSLocalizedDescription = "include is invalid for non-ParseObjects"; code = 121; error = "include is invalid for non-ParseObjects"; }
Is this scenario not supported?
When I re-enable wifi, the meal is successfully added to the online db, but the query failure still happens when I run the query with the includeKey locally.
Am I missing something here? I'm quite surprised to see this failing. It seems like a really basic feature that should work whether local or cloud based.