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