我有这样的数据库数据。
["{37.331622, -122.030337}","{37.331593, -122.03051}","{37.331554, -122.030681}","{37.331383, -122.030757}","{37.33108, -122.030772}","{37.330798, -122.030729}","{37.330636, -122.030636}"]
然后我尝试通过以下代码从数据库中查询数据。
- (void)updateLocations {
CGFloat kilometers = self.radius/1000.0f;
//PFUser *user = [PFUser currentUser];
PFQuery *query = [PFQuery queryWithClassName:@"Session"];
[query whereKey:@"objectId" equalTo:@"t2udAri048"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSLog(@"objects %@",objects);
NSLog(@"path %@",[objects valueForKey:@"Path"]);
NSArray *pointsArray = [objects valueForKey:@"Path"];;
NSInteger pointsCount = pointsArray.count;
CLLocationCoordinate2D pointsToUse[pointsCount];
for(int i = 0; i < pointsCount; i++) {
CGPoint p = CGPointFromString(pointsArray[i]);
pointsToUse[i] = CLLocationCoordinate2DMake(p.x,p.y);
}
MKPolyline *myPolyline = [MKPolyline polylineWithCoordinates:pointsToUse count:pointsCount];
[self.mapView addOverlay:myPolyline];
//NSLog(@"Drawed %@",pointsArray);
}
}];
}
我得到 [objects valueForKey:@"Path"] 的值
( ( "{37.331622, -122.030337}", "{37.331593, -122.03051}", "{37.331554, -122.030681}", "{37.331383, -122.030757}", "{37.33108, -122.0.330779), "{37.33108, -122.0.30779 , -122.030729}”, “{37.330636, -122.030636}” ) )
但我想要它
( "{37.331622, -122.030337}", "{37.331593, -122.03051}", "{37.331554, -122.030681}", "{37.331383, -122.030757}", "{37.33108, -122.0330779}, "{7. -122.030729}", "{37.330636, -122.030636}")
我应该怎么办?