mugunthan
mugunthan

Reputation: 77

Sorting of pfquery with multiple conditions for iOS7

i am trying to sort a pfquery with multiple conditions, the code below sorts only one column. please help.

- (PFQuery *)queryForTable
{
    PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
    [query whereKey:@"mStatus" equalTo:@"running"];
    [query orderByAscending:@"mName"];
    [query orderByAscending:@"mOrder"];
    return query;
}

Upvotes: 5

Views: 1950

Answers (1)

jonahb
jonahb

Reputation: 2580

- (PFQuery *)queryForTable {
    PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
    [query whereKey:@"mStatus" equalTo:@"running"];
    [query orderByAscending:@"mName"];
    [query addAscendingOrder:@"mOrder"];
    return query;
}

Upvotes: 12

Related Questions