簡體   English   中英

解析查詢未按降序加載

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM