0

我在 Parse.com 有一个类,它有一个 x 和 y 字段。x = 10是否有可能通过一个查询来获取和x = 20ANDy = 10和中所说的所有对象y = 20

查询会这样设置吗?

    PFQuery *query1 = [PFQuery queryWithClassName:@"myClass"];
    [query1 whereKey:@"x" greaterThanOrEqualTo:[NSNumber numberWithInt:leftEdge]];
    [query1 whereKey:@"x" lessThanOrEqualTo:[NSNumber numberWithInt:rightEdge]];


    PFQuery *query2 = [PFQuery queryWithClassName:@"myClass"];
    [query1 whereKey:@"y" greaterThanOrEqualTo:[NSNumber numberWithInt:topEdge]];
    [query1 whereKey:@"y" lessThanOrEqualTo:[NSNumber numberWithInt:bottomEdge]];


    PFQuery *query = [PFQuery orQueryWithSubqueries:@[query1, query2]];
4

0 回答 0