I have the following; which fetches the data from the Parse backend and loads the class instances into a NSArray to plug into a UITableView.
var ObjectIDClass = PFQuery(className: "TestObject")
ObjectIDClass.findObjectsInBackgroundWithBlock({
(ObjectsArray : [AnyObject]?, error: NSError?) -> Void in
var ObjectIDs = ObjectsArray as! [PFObject]
for i in 0...ObjectIDs.count-1 {
self.iDArray.append(ObjectIDs[i].valueForKey("objectId") as! String)
self.NameArray.append(ObjectIDs[i].valueForKey("PDFName") as! String)
self.tableView.reloadData()
}
})
This only works with network connection and as soon as the application is closed and then reopened without network, the table is blank. What I am aiming for is to store the data in the Local Datastore and if there is no connectivity, load from the Local Datastore. I can't figure it out using pin, but sure that is how it is done. Any help would be hugely appreciated!
asynchronous@Lamar