簡體   English   中英

如何從相關表中過濾數據(解析)

[英]how to filter data from related table (Parse)

嗨,我必須要桌子,首先是“用戶”表,其次是“付費聊天室”表,這里是結構

這是一個用戶表

這是一個PaidChatroom表

這是我為最近的用戶使用的代碼,它工作正常。

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];


[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    arrAllUser=[objects mutableCopy];


}];

我只需要那些最接近我並購買了約會的用戶,我該如何過濾數據。

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];

[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
    arrAllUser=[objects mutableCopy];

    // Perform your second query here on the objects received inside this block for Purchased dating
}];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM