1
我試圖查看選定基礎上幾個月甚至幾年查詢:我已經得到選定的日期是作爲申報(// dateselectedStr =「2016-11」 )查詢包含日期
並且在線數據庫中的存儲日期包含更新日期與2016-11相同,我如何根據擁有.contain搜索查詢?這是我的小徑
query.order(byDescending: "updatedAt")
if PFUser.current() != nil {
query.whereKey(CARD_UPDATED_AT, contains: dateselectedStr)
query.findObjectsInBackground { (objects, error)-> Void in
if error == nil {
self.recipesArray = objects!
// Reload CollView
self.recipesCollView.reloadData()
let counter = (objects!.count)
print(counter)
self.title = "\(counter) JOB CARDS"
self.hideHUD()
// Hide/show the nothing found Label
if self.recipesArray.count == 0 { self.nothingFoundLabel.isHidden = false
} else { self.nothingFoundLabel.isHidden = true }
} else {
self.simpleAlert("\(error!.localizedDescription)")
self.hideHUD()
}}