犯了一個低級錯誤 檢查了好久,一直試不出來
謹惕一下自己
再用Parse 工具 orderByDescending 的method
想要按照updateAt排序
於是乎
按照範例
PFQuery *query = [PFQuery queryWithClassName:@"Comment"]; // Retrieve the most recent ones
[query orderByDescending:@"createdAt"];
// Only retrieve the last ten
query.limit = 10;
// Include the post data with each comment
[query includeKey:@"post"];
[query findObjectsInBackgroundWithBlock:^(NSArray *comments, NSError *error) {
// Comments now contains the last ten comments, and the "post" field
// has been populated. For example:
for (PFObject *comment in comments) {
// This does not require a network access.
PFObject *post = comment[@"post"];
NSLog(@"retrieved related post: %@", post); }
}];
把[query orderByDescending:@"createdAt"];
createdAt 改為 updateAt
但一直沒辦法按照updateAt排序
困擾我好幾天了。。。
沒想到今天終於找到原因
updateAt =\= updatedAt
知道這個錯誤的時候快吐血了....
總算是解決這個問題了Q_Q