Parse.com
にファイルをアップロードする場合、createdAt
列は自動的に設定されます。Parse.comのcreatedAt列を更新します
私は、これはFUNC現在の時刻にセットされます、createdAt
時間を更新する:
let query = PFQuery(className:"NorgeStory")
query.getObjectInBackgroundWithId(objID[(indexPath?.row)!]) {
(gameScore: PFObject?, error: NSError?) -> Void in
if error != nil {
print(error)
} else if let gameScore = gameScore {
gameScore["isPending"] = false
gameScore["createdAt"] = self.currentDateTime
gameScore.saveInBackground()
gameScore.saveInBackgroundWithBlock({ (success: Bool, error: NSError?) in
if (success) {
// The score key has been incremented
print("Accepted post!")
let alert = UIAlertView()
alert.title = "Innlegg godkjennt!"
alert.message = "Innlegget er godkjennt."
alert.addButtonWithTitle("OK")
alert.show()
self.queryStory()
} else {
// There was a problem, check error.description
print(error?.description)
}
})
}
}
self.currentDateTime
対象商品:let currentDateTime = NSDate()
しかし、どういうわけか、createdAt
は全く変わりません。..どうして?任意のヒント?
ちょうど私が男を探していたもの、ありがとう! ; D –
うれしい私はあなたを助けることができました! :) –