В първия PFQuery (пътници) получавам няколко значения, сред които понякога са далеч един от друг специален идентификатор, който трябва да предава данни във втория PFQuery (пътуване). Данните от първия идентификатор трябва да бъдат предадени в getObjectInBackgroundWithId: XXXX (класово пътуване). Как мога да направя това?
- (void)viewDidLoad {
UISwipeGestureRecognizer *gestureRight;
gestureRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
[[self view] addGestureRecognizer:gestureRight];
PFQuery *passenger = [PFQuery queryWithClassName:@"ClubWorld"];
[passenger getObjectInBackgroundWithId:@"zB96iIkoqo" block:^(PFObject *ClubWorld, NSError *error) {
// Do somethi ng with the returned PFObject in the gameScore variable.
NSLog(@"%@", ClubWorld);
self.firstName.text = ClubWorld[@"firstName"];
self.lastName.text = ClubWorld[@"lastName"];
self.Mileage.text = ClubWorld[@"clubMiles"];
self.withBAFrom.text = ClubWorld[@"withBAFrom"];
self.withFCFrom.text = ClubWorld[@"withFCFrom"];
self.fundsSpent.text = ClubWorld[@"fundsSpent"];
self.lastTrip.text = ClubWorld[@"lastTrip"];
self.previoustripObjectID = ClubWorld[@"lastTrip"];
}];
PFQuery *trip = [PFQuery queryWithClassName:@"Trips"];
[trip getObjectInBackgroundWithId:self.previoustripObjectID block:^(PFObject *TripInformation, NSError *error) {
// Do something with the returned PFObject in the gameScore variable.
NSLog(@"%@", TripInformation);
self.fromCountry.text = TripInformation[@"fromCountry"];
self.toCountry.text = TripInformation[@"toCountry"];
self.departureAirport.text = TripInformation[@"departureAirport"];
self.arrivalAirport.text = TripInformation[@"arrivalAirport"];
self.earnedMiles.text = TripInformation[@"earnedMiles"];
self.flightClass.text = TripInformation[@"flightClass"];
self.departureTime.text = TripInformation[@"departureTime"];
self.arrivalTime.text = TripInformation[@"arrivalTime"];
self.flightCost.text = TripInformation[@"flightCost"];
}];
[super viewDidLoad];
}