tôi có vòng lặp sau đây trong viewDidLoad của tôi:CLLocationCoordinate2D để CLLocation
for(int i=1; i<[eventsArray count]; i++) {
NSArray *componentsArray = [[eventsArray objectAtIndex:i] componentsSeparatedByString:@","];
if([componentsArray count] >=6) {
Koordinate *coord = [[Koordinate alloc] init];
coord.latitude = [[componentsArray objectAtIndex:0] floatValue];
coord.longtitude = [[componentsArray objectAtIndex:1] floatValue];
coord.magnitude = [[componentsArray objectAtIndex:2] floatValue];
coord.depth = [[componentsArray objectAtIndex:3] floatValue];
coord.title = [componentsArray objectAtIndex:4];
coord.strasse = [componentsArray objectAtIndex:5];
coord.herkunft = [componentsArray objectAtIndex:6];
coord.telefon = [componentsArray objectAtIndex:7];
coord.internet = [componentsArray objectAtIndex:8];
[eventPoints addObject:coord];
}
coord là CLLocationCoordinate2D
nhưng làm thế nào tôi có thể sử dụng coord trong phương pháp sau đây, vì tôi cần điều này để có được khoảng cách giữa hai coords :
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
}
hãy giúp tôi tôi bị mắc kẹt!
cảm ơn tất cả các bạn đã giúp đỡ trước
'coord' không phải là' CLLocationCoordinate2D', 'coord' là đối tượng bạn tự tạo, ví dụ' Koordinate'. –