[英]Parse query not loading in descending order
出於某種原因,當我使用Parse將圖像添加到tableView時,它正在從Parse中提取文件,但是沒有按降序加載...不確定為什么?
謝謝你的幫助!
class HomePageViewController:UIViewController,UITableViewDelegate {
@IBOutlet var homePageTableView: UITableView!
var albumImageFiles = [PFFile]()
var imageText = [String]()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
var query = PFQuery(className: "Posts")
query.orderByDescending("createdAT")
query.findObjectsInBackgroundWithBlock { (posts:[AnyObject]?, error: NSError?) -> Void in
if error == nil {
//success fetching objects
for post in posts! {
self.albumImageFiles.append(post["imageFile"] as! PFFile)
self.imageText.append(post["albumText"] as! String)
}
/*reload the table*/
self.homePageTableView.reloadData()
} else {
println(error)
}
}
}
query.orderByDescending("createdAT")
應該
query.orderByDescending("createdAt")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.