Converting CLLocationCoordinates2D into an NSValue
问题 I'm simply trying to convert CLLocationCoordinates into an NSValue to be used in an array brought back later in my app. Here is my code: NSUInteger count = [self.locations count]; CLLocationCoordinate2D coordinates[count]; for (NSInteger i = 0; i < count; i++) { coordinates[i] = [(CLLocation *)self.locations[i] coordinate]; NSValue *locationValue = [NSValue valueWithMKCoordinate:coordinates[i]]; [_locationsArray addObject:locationValue]; NSLog(@"location = %@", _locationsArray); } However the