I am investigating the caching / offline data use within an app design.
The first step was to add the config to the AppDelegate. Following the current iOS SDK guide, this involves:
Parse.enableLocalDatastore()
Before the call to initialize:
Parse.initialize(with: parseConfig)
The only web search result with this error, points me towards a logged GitHub issue with a recommendation to add a property to the Parse configuration, so I now also have (just before the 2 lines of code above):
let parseConfig = ParseClientConfiguration {
$0.applicationId = "someAppId"
$0.clientKey = "someMasterKey"
$0.server = "http://somehost:1337/parse"
$0.isLocalDatastoreEnabled = true
}
This is kicked off with a button press that executes a query which I would like to add to the local store / cache for future use.
let query = PFQuery(className: name)
query.cachePolicy = .cacheElseNetwork
//query.fromLocalDatastore() // I HAVE TRIED WITH THIS ADDED AND COMMENTED OUT
query.whereKey(key, contains: value)
query.includeKey("UserID")
query.findObjectsInBackground { (objects, error) in
// CODE / LOGIC IN HERE
}
Have I structured this correctly?
Can I ask for assistance please?