2015-03-26 7 views
1

Hiii ребята я есть к таблицам, первым является «Пользователь» таблицы и второй это «PaidChatroom» таблица здесь структуракак фильтровать данные из связанной таблицы (Разбор)

This is a user table

this is a PaidChatroom table

Этот код я использовал для ближайшего пользователя, и он работает нормально.

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]; 


}]; 

Я хочу только тех пользователей, которые являются ближайшими ко мне и приобрели датировку, как я могу отфильтровать данные.

+0

Вы можете выполнять вложенные запросы –

ответ

0
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 
}]; 
Смежные вопросы