Ios 如何查询最近3天创建的对象?[parse.com]

Ios 如何查询最近3天创建的对象?[parse.com],ios,swift,parse-platform,Ios,Swift,Parse Platform,在我的应用程序中,用户可以发布内容,我希望用户看到过去3天的内容。是否有一个wherekey,我可以有,只寻找从过去3天的帖子?我正在使用parse作为后端。您可以使用whereKey:greaterThan来解决这个问题 let threeDaysAgo = NSDate().dateByAddingTimeInterval(-259200) query.whereKey("createdAt", greaterThan: threeDaysAgo)

在我的应用程序中,用户可以发布内容,我希望用户看到过去3天的内容。是否有一个wherekey,我可以有,只寻找从过去3天的帖子?我正在使用parse作为后端。

您可以使用whereKey:greaterThan来解决这个问题

let threeDaysAgo = NSDate().dateByAddingTimeInterval(-259200)
query.whereKey("createdAt", greaterThan: threeDaysAgo)