0
我有一個分析查詢運行以收集您所在地區最近的10個拱廊,我試圖讓他們在10個單獨的標籤中顯示這些對象標題。我有下面的代碼收集10最接近,並記錄他們,我試圖開始顯示標籤objectId,但無法弄清楚如何顯示它們,而不僅僅是1.任何建議?查詢對象標題到標籤
PFQuery *query = [PFQuery queryWithClassName:@"Arcade"];
CLLocation *currentLocation = locationManager.location;
PFGeoPoint *userLocation =
[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude
longitude:currentLocation.coordinate.longitude];
query.limit = 10;
[query whereKey:kPAWParseLocationKey nearGeoPoint:userLocation withinMiles:kPAWWallPostMaximumSearchDistance];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
// The find succeeded.
NSLog(@"Successfully retrieved %d scores.", objects.count);
// Do something with the found objects
for (PFObject *object in objects) {
NSLog(@"%@", object.objectId);
NSString *EventTitle = object.objectId;
EventTitle1.text = EventTitle;
for (UIImageView *imageView in self.imageViews) {
__block UIImage *MyPicture = [[UIImage alloc]init];
PFFile *imageFile = [object objectForKey:@"test"];
[imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error){
if (!error) {
MyPicture = [UIImage imageWithData:data];
imageView.image = MyPicture;
}
}];
}
for (UILabel *EventLabel in self.EventTitles){
EventLabel.text = object.objectId;
}
}
更新:我創建了兩個收集出口,然而,當他們展示他們只顯示查詢的最終目標,而不是他們的全部10個?難道我做錯了什麼?
爲什麼選擇標籤?爲什麼不是桌子視圖? – Wain