I have an NSMutableArray
containing TBPosts
that I would like to filter in descending order according to the commentsCount
and likesCount
of the TBPost
.
Initially, the first object in the filtered array will be the object with the largest number of comments and likes, which can be worked out by adding the two together. So I tried the following query and receive an Unable to Parse error. Please can you tell me where I am going wrong?
[posts filterUsingPredicate:[NSPredicate predicateWithFormat:@"post.commentsCount + post.likesCount DESC"]];