0
변경 가능한 배열에 추가하려고하는데이를 이해할 수 없습니다. 양립 할 수없는 데이터 형 double에 대해서, id에 double를 throw합니다. 질문은 거리를 변환하고 배열에 저장하는 방법입니다. 내 배열 "locationDistance"에서 "거리"어떤 도움위치 테이블의 데이터를 변환하는 중 문제가 발생했습니다.
이감사를 저장하기 위해 노력하고
for (int i = 0; i < _getAllLocations.count; i++) {
uscInfo *entity = [_getAllLocations objectAtIndex:i];
NSNumber *numlat=[[NSNumber alloc] initWithDouble:[entity.Latitude doubleValue]];
NSNumber *numlon=[[NSNumber alloc] initWithDouble:[entity.Longitude doubleValue]];
NSLog(@"%d",[_getAllLocations count]);
la=[numlat doubleValue];
lo=[numlon doubleValue];
CLLocation *currentLocation = [[CLLocationalloc]initWithLatitude:lalongitude:lo];////here put your destination point
//NSLog(@"New Location:%@", newLocation);
CLLocationDistance distance = [newLocation distanceFromLocation:currentLocation];
NSLog(@"%@ (%@) %4.0f km from current location",entity.EntityNo, entity.EntityName, distance);
NSLog(@"%@",currentLocation);
, 나는 여전히 일반적으로 아이폰 OS의 새로운뿐만 아니라 프로그램입니다. ,
하지만 문제는 가능성이 배열에 벌거 벗은 CLLocationDistance을 추가하려고 있음을 알 수 있습니다 -
[NSNumber numberWithDouble : distance] 감사합니다. –