Can not retrieve pinned data in local datastore for Swift due to error

313 views Asked by At

I am trying to retrieve data from the local Datastore after 'pinning' my object. Yet when i use the standard code from parse.com (see below) i get two errors:

query.findObjectsInBackground().continueWithBlock { 

// error: " BFTask!' is not a subtype of '<>' "

(task: BFTask!) -> AnyObject in 

// error: " use of undeclared type 'BFTask' "

To me it looks like an error at my side as this is standard parse code. Unfortunately though i can not find any explanation of why this error might happen, or what this BFTask means (in relation to my project). Does anybody have a clue how i can solve this problem? Thanks a lot.

https://www.parse.com/docs/ios/guide#objects-the-local-datastore

let query = PFQuery(className:"GameScore")
query.fromLocalDatastore()
query.getObjectInBackgroundWithId("xWMyZ4YEGZ").continueWithBlock({
(task: BFTask!) -> AnyObject! in
if task.error != nil {
  // There was an error.
  return task
}

  // task.result will be your game score
  return task
})
0

There are 0 answers