I don't find any good and update answers about loading data from Parse to an UITableViewController with sections.
I know that using PFQueryTableViewController is only possible for 1 section.
I have a class Recipes with the following columns in Parse: Section; Name; Calories
Hence my database looks like this Morning; Eggs; 120 Morning, Bacon; 250 Lunch; Meat; 340 ....
I compute a function to query the data from Parse like this:
func queryData(){
var query = PFQuery(className: self.recipesClass as String)
//query.cachePolicy = .CacheElseNetwork
query.orderByDescending("createdAt")
query.findObjectsInBackgroundWithBlock {
(objects: [AnyObject]?, error: NSError?) -> Void in
if error == nil {
// Results were successfully found, looking first on the
// network and then on disk.
// Do something with the found objects
if let objects = objects as? [PFObject] {
for object in objects {
self.tableSections.addObject(object)
}
} else {
// The network was inaccessible and we have no cached data for
// this query.
}
}
}
Where tableSections is a NSMutableArray.
From here, I'm a bit lost on how to proceed to achieve the required results.
Please help,
Thank you in advance
UITableView?